1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
//! OpenTelemetry — trace context in, spans out.
//!
//! Two halves, and the first needs no dependency at all:
//!
//! ```ignore
//! // app/http/kernel.rs — outermost, so every log line carries the trace
//! MiddlewareStack::new().push(Trace::new())
//!
//! // bootstrap.rs, behind the `otlp` feature
//! let layer = Otlp::new("http://localhost:4317", "rainier-sample")
//! .environment("production")
//! .sample_ratio(0.1)
//! .layer()?;
//! ```
//!
//! # Propagation is most of the value
//!
//! [`Trace`] reads the W3C `traceparent` header, joins the trace it names, puts
//! the id on every log line emitted while handling the request, and echoes it
//! back on the response. That is enough to follow one request across four
//! services with `grep`, and it costs nothing — no exporter, no collector, no
//! dependency tree.
//!
//! Reach for the [`otlp`] feature when you want the waterfall view. The
//! rest of the time, an id on a log line is what you actually use.
//!
//! # Sampling belongs upstream
//!
//! A trace that arrives with a decision keeps it, whatever this service is
//! configured to do. A trace sampled in half its services is a trace with holes
//! in it, and holes are worse than no trace at all — you cannot tell a missing
//! span from a call that never happened.
pub use ;
pub use LogFormat;
pub use ;
pub use ;