Expand description
Logging + tracing setup for hwhkit services.
init_loggingacceptsformat = "auto" | "json" | "pretty".autopicks JSON when stdout is not a TTY (production / containers) and pretty when running interactively.- With the
otelfeature enabled,otel_layer::init_with_otelwires an OTLP gRPC exporter into thetracingsubscriber so every span is shipped to the configured collector. - All public init functions return
ObservabilityError; the crate has no remainingResult<_, String>surface (project-wide policy as of 0.6).
Modules§
- otel_
layer - OpenTelemetry-aware initialiser, gated on the
otelfeature. - redis_
instrument - OpenTelemetry instrumentation helpers for the
rediscrate. - reqwest_
instrument - Minimal OpenTelemetry instrumentation middleware for
reqwest. - sqlx_
instrument - Lightweight OpenTelemetry instrumentation helpers for
sqlx.
Structs§
- Logging
Config - Standalone logging configuration for callers that drive
init_loggingdirectly without going through thehwhkit_config::AppConfigpipeline. - Otel
Config - Standalone OTLP/OTel configuration for callers that drive
otel_layer::init_with_oteldirectly. Mirrorshwhkit_config::OtelConfig.
Enums§
- Observability
Error - Error returned by the public initialisation entry points
(
init_logging,otel_layer::init_with_otel).
Functions§
- init_
logging - Initialize tracing logging without OTel. Safe to call once per process.