Expand description
Observability infrastructure for Barbacane API Gateway.
This crate provides:
- Structured JSON logging with trace correlation
- Prometheus metrics registry and exposition
- Distributed tracing with W3C Trace Context
- OTLP export to OpenTelemetry Collector
§Usage
ⓘ
use barbacane_telemetry::{TelemetryConfig, Telemetry};
let config = TelemetryConfig::new()
.with_log_level("info")
.with_otlp_endpoint("http://localhost:4317");
let telemetry = Telemetry::init(config)?;Re-exports§
pub use config::LogFormat;pub use config::OtlpProtocol;pub use config::TelemetryConfig;pub use logging::events;pub use metrics::MetricsRegistry;pub use prometheus::PROMETHEUS_CONTENT_TYPE;pub use tracing::attributes;pub use tracing::spans;pub use tracing::TracingContext;
Modules§
- config
- Telemetry configuration.
- export
- OTLP export for traces and metrics.
- logging
- Structured logging with JSON output and trace correlation.
- metrics
- Prometheus metrics registry.
- prometheus
- Prometheus text exposition format rendering.
- tracing
- Distributed tracing with W3C Trace Context.
Macros§
- log_
artifact_ loaded - log_
dispatch_ error - log_
listening - log_
middleware_ short_ circuit - log_
plugin_ initialized - log_
request_ completed - log_
shutdown - log_
startup - Helper macros for structured logging with standard fields.
- log_
validation_ failure - log_
wasm_ trap
Structs§
- Telemetry
- Main telemetry handle.
Enums§
- Telemetry
Error - Telemetry errors.