Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Use tags rather than time-based logs for information on requests

Mikail KOCAK6da0ce5f0b51
diff --git a/CHANGELOG.md b/CHANGELOG.md
index e68147b6cc..ebc845b1c2 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -8,6 +8,7 @@ All notable, unreleased changes to this project will be documented in this file.
- Add ability to query category, collection or product by slug - #5574 by @koradon
## 2.10.0
+- Use tags rather than time-based logs for information on requests - #5608 by @NyanKiyoshi
- OpenTracing support - #5188 by @tomaszszymanski129
- Account confirmation email - #5126 by @tomaszszymanski129
diff --git a/saleor/graphql/views.py b/saleor/graphql/views.py
index 6dbe584688..f0a1755b29 100644
--- a/saleor/graphql/views.py
+++ b/saleor/graphql/views.py
@@ -139,9 +139,7 @@ class GraphQLView(View):
else:
continue
span.set_tag("http.client_ip", ip)
- span.log_kv(
- {"http.client_ip_originated_from": settings.REAL_IP_ENVIRON}
- )
+ span.set_tag("http.client_ip_originated_from", settings.REAL_IP_ENVIRON)
break
response = self._handle_query(request)
@@ -218,13 +216,10 @@ class GraphQLView(View):
return error
if document is not None:
- span.log_kv(
- {
- "query": document.document_string[
- : settings.OPENTRACING_MAX_QUERY_LENGTH_LOG
- ]
- }
- )
+ raw_query_string = document.document_string[
+ : settings.OPENTRACING_MAX_QUERY_LENGTH_LOG
+ ]
+ span.set_tag("graphql.query", raw_query_string)
extra_options: Dict[str, Optional[Any]] = {}