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

opentelemetry-instrumentation-asgi: emit error.type attribute when having exceptions #2699

Open
emdneto opened this issue Jul 11, 2024 · 3 comments · May be fixed by #2719
Open

opentelemetry-instrumentation-asgi: emit error.type attribute when having exceptions #2699

emdneto opened this issue Jul 11, 2024 · 3 comments · May be fixed by #2719
Labels
bug Something isn't working

Comments

@emdneto
Copy link
Member

emdneto commented Jul 11, 2024

Describe your environment

instrumentation-asgi: 0.47b0.dev

What happened?

instrumentation-asgi isn't setting error.type during exceptions and we should set it in the new semconv as defined here

Steps to Reproduce

Run any asgi example which raises exception before status code is sent or received using the new semconv opt-in mode

Expected Result

If the request fails with an error before response status code was sent or received, error.type SHOULD be set to exception type (its fully-qualified class name, if applicable) or a component-specific low cardinality error identifier.

Exception present in error.type

Actual Result

No error.type attribute set in spans

Additional context

#2682

https://github.com/open-telemetry/semantic-conventions/blob/main/docs/http/http-spans.md#http-server-semantic-conventions

Would you like to implement a fix?

None

@emdneto emdneto added the bug Something isn't working label Jul 11, 2024
@emdneto emdneto changed the title opentelemetry-instrumentation-asgi: emiterror.type attribute when having errors opentelemetry-instrumentation-asgi: emit error.type attribute when having errors Jul 12, 2024
@emdneto emdneto changed the title opentelemetry-instrumentation-asgi: emit error.type attribute when having errors opentelemetry-instrumentation-asgi: emit error.type attribute when having exceptions Jul 12, 2024
@shijiadong2022 shijiadong2022 removed their assignment Jul 17, 2024
@qiuge615
Copy link
Contributor

Shall I work this? And one question, can I reference opentelemetry-instrumentation-httpx error.type for asgi?
https://github.com/open-telemetry/opentelemetry-python-contrib/blob/main/instrumentation/opentelemetry-instrumentation-httpx/src/opentelemetry/instrumentation/httpx/__init__.py#L369

@emdneto
Copy link
Member Author

emdneto commented Jul 17, 2024

Hey @qiuge615, I'm Sorry, I didn't see this before. I opened the PR to include it in the upcoming release. Please feel free to review the PR.

@qiuge615
Copy link
Contributor

Thank you for your help.

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
3 participants