Skip to content

5.2.0 — 2026-09-07

← 5.2.1 | 5.1.0 → | ↑ 5.x series

Added

Configs - OpenTelemetry

  • OtelMetricsExporter enum - Unique metrics exporter via METRICS_EXPORTER (otlp | pull) with optional pull bind host/port.
    • otlp (default): push via periodic OTLP export
    • pull: dedicated scrape HTTP server on METRICS_PULL_HOST:METRICS_PULL_PORT/metrics
  • OtelLogsExporter enum - Unique logs exporter via LOGS_EXPORTER (console | otlp); default console splits INFO/DEBUG → stdout and WARNING+ → stderr
  • LOGS_ENABLED default true - Log export on when OTel is enabled (console by default; switch to otlp for collectors)
  • METRICS_PULL_PORT default 8200 - Default scrape bind port for pull metrics
  • SYSTEM_METRICS_ENABLED - Kill switch for SystemMetricsInstrumentor (default true when metrics are on)

Helpers - OpenTelemetry

  • Metrics pull scrape lifecycle - Owned scrape server start/stop tied to OtelUtils init, shutdown, fork reset, and test reset
  • gRPC RPC duration metrics - Sync/async rpc.server.duration server interceptors installed by AppUtils when metrics are enabled (independent of traces)
  • metric_status_for_exception - Aligns decorator/RPC metric status with span status (BaseError HTTP < 500 → ok)
  • Duration histogram quality - Description plus explicit second bucket boundaries on function and gRPC duration histograms

Dependencies

  • opentelemetry-exporter-prometheus - Added to the otel extra to implement the pull scrape exporter

Tests

Tests - OpenTelemetry

  • Pull scrape BDD - Scrape 200, pull-only, invalid exporter enum, disabled port, idempotent init, shutdown
  • Console logs BDD - Invalid LOGS_EXPORTER, INFO → stdout, WARNING → stderr
  • Metrics gaps BDD - gRPC rpc.server.duration without hand-rolled decorators, metrics-only gRPC, client BaseError metric status, system metrics off

Docs

Docs - Observability

  • Push vs pull - Documented METRICS_EXPORTER, scrape security/prefork notes, gRPC RPC metrics, status alignment, and instrument-name lowercasing gotchas