Expand description
Logging utilities
Modules§
- otlp
opentelemetry-grpc
oropentelemetry-http
Opentelemetry types that might be needed downstream. The aim is to avoid the user having to depend on opentelemetry crates directly.
Structs§
- The global logger/tracer for stdout, file and full open telemetry. Works with the tracing crates (info!, debug!, warn!, error!) and span funcs and decorators.
- The global log builder. See the
GlobalLog
struct for more information.
Functions§
- Force through logs, traces and metrics, useful in e.g. testing.
- global_meter
opentelemetry-grpc
oropentelemetry-http
Returns the defaultopentelemetry::metrics::Meter
for the app, labelled “default”. - init_system_and_process_metrics
system
and (opentelemetry-grpc
oropentelemetry-http
)Automatically record system metrics: SYSTEM WIDE: - meter
opentelemetry-grpc
oropentelemetry-http
Returns a newopentelemetry::metrics::Meter
with the provided name and default configuration. - Record an exception to the currently active span, making sure the record location is added to the stacktrace. Matches oltp spec so it shows up correctly as an exception in observers https://opentelemetry.io/docs/specs/semconv/exceptions/exceptions-spans/
- set_response_headers_from_ctx
opentelemetry-grpc
oropentelemetry-http
Set the response headers from the current span context. So downstream services can continue the current trace. - set_span_parent_from_http_headers
opentelemetry-grpc
oropentelemetry-http
Connect this program’s span to the trace that is represented by the provided HTTP headers. E.g. connect an axum handler’s trace/span to the nginx trace/span. - Shutdown the logger, traces and metrics, should be called when the program is about to exit.