Skip to content

Conversation

shivanshuraj1333
Copy link
Member

Fixes: #3169

SpanAttributes.MESSAGING_DESTINATION, routing_key
)

value = str(value)
Copy link
Contributor

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

Copy link
Member Author

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

Copy link
Contributor

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 :)

Copy link
Member Author

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!

@shivanshuraj1333 shivanshuraj1333 force-pushed the fix/issues/3169 branch 2 times, most recently from d66fd13 to 49a86ba Compare February 13, 2025 11:12
@shivanshuraj1333 shivanshuraj1333 requested a review from a team as a code owner February 13, 2025 11:30
@xrmx xrmx changed the title Use python dict instead of string as attribute value to enable parsing celery: use python dict instead of string as attribute value to enable parsing Feb 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Ready for review

Development

Successfully merging this pull request may close these issues.

Make span attributes json parseable for celery

2 participants