$ 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"}
Hello, many thanks for this crate!
It looks like
DefaultRootSpanBuilderdoesn't inserttrace_idvalue in the REQUEST - START span. Next spans do it fine. Maybetrace_idextracting insideset_otel_parentshould be before callinginner_spaninroot_spanmacro?Is this behaviour intentional or we can fix it?
You can reproduce this with
examples/opentelemetryexample: