Skip to content
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

Make span attributes json parseable for celery #3169

Open
shivanshuraj1333 opened this issue Jan 6, 2025 · 0 comments · May be fixed by #3170
Open

Make span attributes json parseable for celery #3169

shivanshuraj1333 opened this issue Jan 6, 2025 · 0 comments · May be fixed by #3170
Labels
bug Something isn't working

Comments

@shivanshuraj1333
Copy link
Member

shivanshuraj1333 commented Jan 6, 2025

Describe your environment

OS: (e.g, Ubuntu)
Python version: (e.g., Python 3.8.10)
Package version: (e.g., 0.46.0)

What happened?

Currently, the "delivery_info" attribute in celery is a string and not a map (or even a json).
The attribute is transformed into a string, which makes it hard to parse, and one has to use regex instead.

Steps to Reproduce

Run the celery instrumentation application from https://github.com/shivanshuraj1333/celery-opentelemetry-instrumentation/

Expected Result

attribute name: celetry.delivery_info

option 1: return a python dict

{
    'exchange': '',
    'routing_key': 'queue2',
    'priority': 0,
    'redelivered': False
}

option 2: return a valid json

{
  "exchange": "",
  "routing_key": "queue2",
  "priority": 0,
  "redelivered": false
}

A dict is supported by semconv and proto message https://github.com/open-telemetry/opentelemetry-proto/blob/main/opentelemetry/proto/common/v1/common.proto#L37

Also, the unmarshalling is already supported, see.

So, let's go for having option 1 makes sense, since, it helps in extracting the keys from map values of an attribute

Actual Result

attribute name: celetry.delivery_info
value: {'exchange': '', 'routing_key': 'queue2', 'priority': 0, 'redelivered': False}

Additional context

No response

Would you like to implement a fix?

None

@shivanshuraj1333 shivanshuraj1333 added the bug Something isn't working label Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
1 participant