Skip to main content

Crate hwhkit_observability

Crate hwhkit_observability 

Source
Expand description

Logging + tracing setup for hwhkit services.

  • init_logging accepts format = "auto" | "json" | "pretty". auto picks JSON when stdout is not a TTY (production / containers) and pretty when running interactively.
  • With the otel feature enabled, otel_layer::init_with_otel wires an OTLP gRPC exporter into the tracing subscriber so every span is shipped to the configured collector.
  • All public init functions return ObservabilityError; the crate has no remaining Result<_, String> surface (project-wide policy as of 0.6).

Modules§

otel_layer
OpenTelemetry-aware initialiser, gated on the otel feature.
redis_instrument
OpenTelemetry instrumentation helpers for the redis crate.
reqwest_instrument
Minimal OpenTelemetry instrumentation middleware for reqwest.
sqlx_instrument
Lightweight OpenTelemetry instrumentation helpers for sqlx.

Structs§

LoggingConfig
Standalone logging configuration for callers that drive init_logging directly without going through the hwhkit_config::AppConfig pipeline.
OtelConfig
Standalone OTLP/OTel configuration for callers that drive otel_layer::init_with_otel directly. Mirrors hwhkit_config::OtelConfig.

Enums§

ObservabilityError
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.