Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
App name tracing (#8936)
Tomasz Szymański0896ebfc6e01
diff --git a/saleor/core/tracing.py b/saleor/core/tracing.pyindex bb8a749adf..a156b18d95 100644--- a/saleor/core/tracing.py+++ b/saleor/core/tracing.py@@ -44,7 +44,7 @@ def webhooks_opentracing_trace(span_name, domain, sync=False, app_name=None):) as scope:span = scope.spanif app_name:- span.set_tag("webhooks.app", app_name)+ span.set_tag("app.name", app_name)span.set_tag(opentracing.tags.COMPONENT, "webhooks")span.set_tag("service.name", "webhooks")span.set_tag("webhooks.domain", domain)diff --git a/saleor/graphql/views.py b/saleor/graphql/views.pyindex 660738e203..085ee189d0 100644--- a/saleor/graphql/views.py+++ b/saleor/graphql/views.py@@ -321,9 +321,14 @@ class GraphQLView(View):if should_use_cache_for_scheme:cache.set(key, response)+ if app := getattr(request, "app", None):+ span.set_tag("app.name", app.name)+return set_query_cost_on_result(response, query_cost)except Exception as e:span.set_tag(opentracing.tags.ERROR, True)+ if app := getattr(request, "app", None):+ span.set_tag("app.name", app.name)# In the graphql-core version that we are using,# the Exception is raised for too big integers value.# As it's a validation error we want to raise GraphQLError instead.