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

Missing trace_id value in REQUEST - START #109

Open
oriontvv opened this issue Jul 6, 2023 · 1 comment
Open

Missing trace_id value in REQUEST - START #109

oriontvv opened this issue Jul 6, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@oriontvv
Copy link

oriontvv commented Jul 6, 2023

Hello, many thanks for this crate!
It looks like DefaultRootSpanBuilder doesn't insert trace_id value in the REQUEST - START span. Next spans do it fine. Maybe trace_id extracting inside set_otel_parent should be before calling inner_span in root_span macro?
Is this behaviour intentional or we can fix it?
You can reproduce this with examples/opentelemetry example:

$ curl -v http://localhost:8080/hello --header "traceparent:00-80e1afed08e019fc1110464cfa66635c-7a085853722dc6d2-01"
{"v":0,"name":"tracing-actix-web-demo","msg":"[HTTP REQUEST - START]","level":30,"hostname":"macbook-C02G91XWMD6R","pid":72599,"time":"2023-07-06T17:01:00.931497Z","target":"tracing_actix_web::root_span_builder","line":54,"file":"src/root_span_builder.rs","http.scheme":"http","request_id":"8f96e234-264b-493d-89c3-842c927e85d3","http.client_ip":"127.0.0.1","http.route":"/hello","http.user_agent":"curl/7.88.1","http.target":"/hello","http.flavor":"1.1","otel.kind":"server","http.method":"GET","otel.name":"HTTP GET /hello","http.host":"localhost:8080"}

{"v":0,"name":"tracing-actix-web-demo","msg":"[HTTP REQUEST - END]","level":30,"hostname":"macbook-C02G91XWMD6R","pid":72599,"time":"2023-07-06T17:01:00.931786Z","target":"tracing_actix_web::root_span_builder","line":54,"file":"src/root_span_builder.rs","request_id":"8f96e234-264b-493d-89c3-842c927e85d3","http.route":"/hello","http.user_agent":"curl/7.88.1","http.target":"/hello","http.flavor":"1.1","http.status_code":200,"http.method":"GET","http.host":"localhost:8080","http.scheme":"http","http.client_ip":"127.0.0.1","elapsed_milliseconds":0,"otel.status_code":"OK","otel.kind":"server","trace_id":"80e1afed08e019fc1110464cfa66635c","otel.name":"HTTP GET /hello"}
@oriontvv oriontvv changed the title Missing trace_id value Missing trace_id value in REQUEST - START Jul 9, 2023
@LukeMathWalker
Copy link
Owner

I'm fuzzy on the details, but I seem to recall that it's not easy/straight-forward to extract it before creating the span.
If you manage to, happy to merge it in!

@LukeMathWalker LukeMathWalker added the enhancement New feature or request label Jul 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants