Skip to content

[Bug]: opentelemetry-appender-tracing (with experimental_use_tracing_span_context enabled) + axum-tracing-opentelemetry integration issue #2803

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

Open
Rudo2204 opened this issue Mar 14, 2025 · 0 comments
Labels
bug Something isn't working triage:todo Needs to be traiged.

Comments

@Rudo2204
Copy link

Rudo2204 commented Mar 14, 2025

What happened?

opentelemetry-appender-tracing (with experimental_use_tracing_span_context enabled #2438) failed to export trace_id when ingerating with with axum-tracing-opentelemetry's middlewares.

Context: I wanted to integrate my loco-rs app with axum-tracing-opentelemetry to get more telemetry data out of request & response. I followed the example in loco-extras (it's outdated at the moment), and managed to get it working. However when the middlewares from axum-tracing-opentelemetry are added, trace_id is no longer being exported.

Minimal repo with steps to reproduce the issue: https://github.com/Rudo2204/loco_otel_integration_issue (please read the steps in README file)

I don't think there is a problem with opentelemetry-appender-tracing, rather it likely has something to do with
tracing-opentelemetry-instrumentation-sdk creating a new span and setting trace_id to tracing::field::Empty? They seem to use a hack to get the trace_id from handler if needed.

OpenTelemetry API Version (i.e version of opentelemetry crate)

0.28.0

OpenTelemetry SDK Version (i.e version of opentelemetry_sdk crate)

0.28.0

What Exporter(s) are you seeing the problem on?

OTLP

Relevant log output

@Rudo2204 Rudo2204 added bug Something isn't working triage:todo Needs to be traiged. labels Mar 14, 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 triage:todo Needs to be traiged.
Projects
None yet
Development

No branches or pull requests

1 participant