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

The otel::tracing log level is not set to the same or lower level than TRACING_LEVEL, which makes span.set_parent() invalid. #148

Open
Lvzhenqian opened this issue Jul 12, 2024 · 4 comments

Comments

@Lvzhenqian
Copy link

Cargo.toml

axum = "0.7"
tracing = "0.1"
tracing-opentelemetry = "0.24.0"
opentelemetry = "0.23.0"
opentelemetry_sdk = { version = "0.23.0", features = ["rt-tokio"] }
opentelemetry-otlp = { version = "0.16", features = ["trace", "tonic"] }
opentelemetry-semantic-conventions = "0.15"
axum-tracing-opentelemetry = "0.19"
tracing-opentelemetry-instrumentation-sdk = { version = "0.19", features = [
    "tracing_level_info",
] }
init-tracing-opentelemetry = "0.19"
tracing-subscriber = { version = "0.3", features = [
    "env-filter",
    "std",
    "local-time",
    "ansi",
    "json",
] }
tracing-appender = "0.2"

The span generated before setting will not bring in the traceparent id of the http request:
1
After configuring the tagger log level, it can be normally associated with the incoming trace:
2

@davidB
Copy link
Owner

davidB commented Aug 31, 2024

I release a new version of axum-tracing-opentelemetry with the missing feature flag "tracing_level_info".

Bad new, this version is for opentelemetry 0.24 and the auto-bump version releases axum-tracing-opentelemetry with version 0.19.1

@lcmgh
Copy link

lcmgh commented Sep 4, 2024

My tracing otlp tonic export setup works pretty fine but tonic-tracing-opentelemetry = { version = "0.20.0", features = ["tracing_level_info"] } is not exporting / producing anything to my otel backend (jaeger).

For other things I use tracing-opentelemetry = "0.25.0"

My overcall tracing level is INFO. I tried with and without ["tracing_level_info"] so I don't really know what's going on.

@davidB
Copy link
Owner

davidB commented Sep 22, 2024

opentelemetry use static variables, you should not have multiple version of opentelemetry (else tracer could not be connected to your configured exporter,...)

# Check only one version of opentelemetry_api should be used
# else issue with setup of global (static variable)
# check_single_version_opentelemtry:
cargo tree -i opentelemetry_api

@lcmgh
Copy link

lcmgh commented Sep 24, 2024

Before using this crate I have no results for cargo tree -i opentelemetry_api.

For cargo tree -i opentelemetry_sdk I get

opentelemetry_sdk v0.24.1
├── opentelemetry-otlp v0.17.0
│   └── private-init v0.1.33 
│       └── myservice v0.1.0 (/Users/user/Code/..)
├── opentelemetry-proto v0.7.0
│   └── opentelemetry-otlp v0.17.0 (*)
├── private-init v0.1.33
└── tracing-opentelemetry v0.25.0
    └── private-init v0.1.33 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants