Expand description
§pleme-observability
Observability library for Pleme platform services.
§Features
- Structured Logging - JSON logging with tracing
- Distributed Tracing - OpenTelemetry integration (feature-gated)
- Metrics - Prometheus metric definition macros and tracking helpers
- Context Propagation - W3C Trace Context
§Quick Start
ⓘ
use pleme_observability::init_observability;
fn main() {
// Auto-detects: uses OTel if OTEL_EXPORTER_OTLP_ENDPOINT is set,
// otherwise falls back to basic JSON tracing.
init_observability("my-service");
tracing::info!("Service started");
}Re-exports§
pub use logging::init_tracing;pub use metrics::MetricsCollector;
Modules§
- logging
- Structured logging setup
- macros
- Declarative macros for Prometheus metric definitions.
- metrics
- Prometheus metrics collection
- tracking
- Generic infrastructure tracking helpers.
Macros§
- create_
metric - Helper macro to create a Prometheus metric from its kind and metadata.
- define_
metrics - Main macro for defining a Prometheus metrics struct with auto-registration.
- metric_
field_ type - Helper macro to determine the Prometheus field type from a metric kind.
Enums§
- Observability
Error - Observability errors
Functions§
- init_
observability - Initialize observability with automatic environment detection.
Type Aliases§
- Result
- Result type for observability operations