1
1
//! # W3C Trace Context Propagator
2
2
//!
3
- //! The `traceparent` header represents the incoming request in a
4
- //! tracing system in a common format, understood by all vendors.
5
- //! Here’s an example of a `traceparent` header.
6
- //!
7
- //! `traceparent: 00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01`
8
- //!
9
- //! The `traceparent` HTTP header field identifies the incoming request in a
10
- //! tracing system. It has four fields:
11
- //!
12
- //! - version
13
- //! - trace-id
14
- //! - parent-id
15
- //! - trace-flags
16
- //!
17
- //! See the [w3c trace-context docs] for more details.
18
- //!
19
- //! [w3c trace-context docs]: https://w3c.github.io/trace-context/
3
+
20
4
use once_cell:: sync:: Lazy ;
21
5
use opentelemetry:: {
22
6
propagation:: { text_map_propagator:: FieldIter , Extractor , Injector , TextMapPropagator } ,
@@ -33,8 +17,31 @@ const TRACESTATE_HEADER: &str = "tracestate";
33
17
static TRACE_CONTEXT_HEADER_FIELDS : Lazy < [ String ; 2 ] > =
34
18
Lazy :: new ( || [ TRACEPARENT_HEADER . to_owned ( ) , TRACESTATE_HEADER . to_owned ( ) ] ) ;
35
19
36
- /// Propagates `SpanContext`s in [W3C TraceContext] format.
20
+ /// Propagates `SpanContext`s in [W3C TraceContext] format under `traceparent` and `tracestate` header.
21
+ ///
22
+ /// The `traceparent` header represents the incoming request in a
23
+ /// tracing system in a common format, understood by all vendors.
24
+ /// Here’s an example of a `traceparent` header.
25
+ ///
26
+ /// `traceparent: 00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01`
27
+ ///
28
+ /// The `traceparent` HTTP header field identifies the incoming request in a
29
+ /// tracing system. It has four fields:
30
+ ///
31
+ /// - version
32
+ /// - trace-id
33
+ /// - parent-id
34
+ /// - trace-flags
35
+ ///
36
+ /// The `tracestate` header provides additional vendor-specific trace
37
+ /// identification information across different distributed tracing systems.
38
+ /// Here's an example of a `tracestate` header
39
+ ///
40
+ /// `tracestate: vendorname1=opaqueValue1,vendorname2=opaqueValue2`
41
+ ///
42
+ /// See the [w3c trace-context docs] for more details.
37
43
///
44
+ /// [w3c trace-context docs]: https://w3c.github.io/trace-context/
38
45
/// [W3C TraceContext]: https://www.w3.org/TR/trace-context/
39
46
#[ derive( Clone , Debug , Default ) ]
40
47
pub struct TraceContextPropagator {
0 commit comments