Expand description
Everything needed to set up telemetry (logs, traces, metrics) for both clients and servers.
Despite the name re_perf_telemetry, this actually handles all forms of telemetry,
including all log output.
This sort of telemetry is always disabled on our OSS binaries, and is only used for
- The Rerun Cloud infrastructure
- Profiling by Rerun developer
§Logging strategy
-
All our logs go through the structured
tracingmacros. -
We always log from
tracingdirectly into stdio: we never involve theOpenTelemetrylogging API. Production is expected to read the logs from the pod’s output. There is never any internal buffering going on, besides the buffering of stdio itself. -
All logs that happen as part of the larger trace/span will automatically be uploaded with that trace/span. This makes our traces a very powerful debugging tool, in addition to a profiler.
§Tracing strategy
-
All our traces go through the structured
tracingmacros. We never use theOpenTelemetrymacros. -
The traces go through a first layer of filtering based on the value of
RUST_TRACE, which functions similarly to aRUST_LOGfilter. -
The traces are then sent to the
OpenTelemetrySDK, where they will go through a pass of sampling before being sent to the OTLP endpoint. The sampling mechanism is controlled by the official OTEL environment variables. -
Spans that contains error logs will properly be marked as failed, and easily findable.
§Metric strategy
-
Our metric strategy is basically the opposite of our logging strategy: everything goes through
OpenTelemetrydirectly,tracingis never involved. -
Metrics are uploaded (as opposed to scrapped!) using the OTLP protocol, on a fixed interval defined by the
OTEL_METRIC_EXPORT_INTERVALenvironment variable.
Modules§
Structs§
- Grpc
Make Span - Implements
tower_http::trace::MakeSpanwhere the trace name is the gRPC method name. - Grpc
OnEos - Implements a
tower_http::trace::OnEosmiddleware. - Grpc
OnFirst Body Chunk - Implements a
tower_http::trace::OnBodyChunkmiddleware, but only accounts for the first one. - Grpc
OnRequest - Implements a
tower_http::trace::OnRequestmiddleware. - Grpc
OnResponse - Implements a
tower_http::trace::OnResponsemiddleware. - Grpc
OnResponse Options - Telemetry
- The Redap telemetry pipeline.
- Telemetry
Args - Complete configuration for all things telemetry.
- Telemetry
Layer Options - Trace
Headers - Trace
IdLayer - A
tracing_subscriber::Layerthat injects the opentelemetrytrace_idas abenchmark_idfield top level field on every span. - Tracing
Injector Interceptor - This implements a
tonic::service::Interceptorthat injects trace/span metadata into the request headers, according to W3C standards.
Enums§
Constants§
- TRACE_
CONTEXT_ VAR_ NAME - The name of the
ContextVarused for trace context propagation
Traits§
Functions§
- current_
trace_ headers - Export the active trace in the current context as the W3C trace headers, if any.
- current_
trace_ id - Returns the active
TraceIdin the current context, if any. - new_
client_ telemetry_ layer - Creates a new
tower::Layermiddleware that automatically: - new_
server_ telemetry_ layer - Creates a new
tower::Layermiddleware that automatically: - to_
short_ str - Displays a possibly long list of items to a length limited list of items.