Observability Module¶
Logging, tracing, and OpenTelemetry integration.
Classes¶
| Class | Description |
|---|---|
| Logging | Structured logging |
| Tracing | Request tracing |
| OpenTelemetry | OTel integration |
Quick Example¶
from mamba_agents.observability import (
setup_logging,
RequestTracer,
get_otel_integration,
)
from mamba_agents.config import LoggingConfig
# Setup logging
config = LoggingConfig(level="INFO", format="json")
logger = setup_logging(config)
# Request tracing
tracer = RequestTracer()
tracer.start_trace()
with tracer.start_span("operation") as span:
span.set_attribute("key", "value")
trace = tracer.end_trace()
# OpenTelemetry
otel = get_otel_integration()
otel.initialize()