-
Notifications
You must be signed in to change notification settings - Fork 657
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
celery: use python dict instead of string as attribute value to enable parsing #3170
base: main
Are you sure you want to change the base?
celery: use python dict instead of string as attribute value to enable parsing #3170
Conversation
@@ -95,8 +95,6 @@ def set_attributes_from_context(span, context): | |||
SpanAttributes.MESSAGING_DESTINATION, routing_key | |||
) | |||
|
|||
value = str(value) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this does match with the value an attributes can have https://opentelemetry.io/docs/concepts/signals/traces/#attributes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I opened this and realized that it is intentional.
Right now, since we do value = str(value)
the map becomes tricky to parse (filtering based on key).
How about if I flatten the map and then stringily (or convert to corresponding datatype) the values?
celery.delivery_info ⇒ `{'exchange': '', 'routing_key': 'distilled-guidance-dpo-25-10k-v1', 'priority': 0, 'redelivered': False}`
would become
celery.delivery_info.exchange: "routing_key"
celery.delivery_info.routing_key: "distilled-guidance-dpo-25-10k-v1"
celery.delivery_info.priority: 0
celery.delivery_info.redelivered: false
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Flattening the map would indeed be better I think than going out of spec :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have updated the changes to add span attributes with flattened map. PTAL, thanks!
d66fd13
to
49a86ba
Compare
f486f6f
to
a9c895e
Compare
Signed-off-by: Shivanshu Raj Shrivastava <[email protected]>
a9c895e
to
bc76989
Compare
Fixes: #3169