Browse Source

ref(proj-config): Add context info to build task (#41118)

Looking at transactions in the performance product, it's impossible to
know if tasks that take longer (including outliers) are all coming from
the same project or from different projects. Adding the public key as a
tag addresses that issue.

This function is called in a single place and all the additional
parameters that go into `kwargs` is the time the task was scheduled,
which is not useful information, so I've decided to not include it (as
the context). We may want to revisit this in the future.
Iker Barriocanal 2 years ago
parent
commit
13e7532088
1 changed files with 2 additions and 0 deletions
  1. 2 0
      src/sentry/tasks/relay.py

+ 2 - 0
src/sentry/tasks/relay.py

@@ -32,6 +32,8 @@ def build_project_config(public_key=None, **kwargs):
 
     Do not invoke this task directly, instead use :func:`schedule_build_project_config`.
     """
+    sentry_sdk.set_tag("public_key", public_key)
+
     try:
         from sentry.models import ProjectKey