Expand description
OpenTelemetry metrics. Every instrument the gateway emits lives on one
GatewayMetrics, passed explicitly (there is no global recorder). The
Prometheus and OTLP exporters sit behind the server feature.
Re-exports§
pub use exporter::install;pub use exporter::metrics_router;pub use exporter::MetricsExporter;
Structs§
- Gateway
Metrics - Every instrument the gateway records. Build once, share behind an
Arc. - Metrics
Exporter - The Prometheus registry plus the provider feeding it. Keep it alive for the process lifetime: dropping the last provider handle shuts every reader down, and scrapes come back empty.
Constants§
- SECONDS_
BUCKETS - Second-scaled histogram boundaries; OTel’s defaults are millisecond-scaled.
Functions§
- install
- Build the meter provider and the gateway’s instruments. Prometheus is
always on; OTLP/HTTP is added when
otlp_endpoint(a base collector URL such ashttp://collector:4318) is set. opentelemetry-otlp 0.32 uses programmatic endpoints verbatim, so/v1/metricsis appended here. - metrics_
router GET /metrics(andGET /) in Prometheus text format.- seconds_
histogram - A duration histogram in seconds with
SECONDS_BUCKETSboundaries.