Skip to content

v2.2.0

Choose a tag to compare

@github-actions github-actions released this 02 Oct 05:44
· 26 commits to main since this release
v2.2.0
144d6bd

Moves chapkit onto servicekit 3. HTTP metrics now come from FastAPI's built-in OpenTelemetry, and /metrics is on by default. Chapkit's own API is unchanged, but /metrics series names change for anyone scraping them.

Changed

  • Requires servicekit>=3.0.0,<4 (previously >=2.0.3,<3), which brings in fastapi>=0.142.2. servicekit 3 replaces opentelemetry-instrumentation-fastapi with FastAPI's built-in OpenTelemetry. See the servicekit v3.0.0 release notes for the full list. (#128)
  • HTTP metric series on /metrics are renamed to the stable OpenTelemetry semantic conventions: http_server_duration_milliseconds_* becomes http_server_request_duration_seconds_*, with labels http_request_method, http_response_status_code and http_route. Durations are in seconds.
  • Monitoring is on by default. Every ServiceBuilder / MLServiceBuilder service exposes /metrics even without .with_monitoring(). Scaffolded projects already call it, so generated services behave the same.
  • Web console Monitoring page reads the new metric names for request rate and average latency, and still shows latency in ms.

Added

  • OTLP export through FastAPI OpenTelemetry. Setting OTEL_EXPORTER_OTLP_ENDPOINT (and optionally OTEL_SERVICE_NAME) sends request traces, metrics and logs to an OpenTelemetry collector, in addition to Prometheus scraping.

Upgrading

  • Model services: bump to chapkit>=2.2.0,<3. No code changes needed.
  • Prometheus queries, Grafana panels and alerts on chapkit services need the new metric and label names. Millisecond thresholds must be divided by 1000.
  • To expose no metrics endpoint, use .with_monitoring(enabled=False). Removing the .with_monitoring() call no longer turns it off.
  • If a deployment sets OTEL_* variables for other tools, the service will now export over OTLP too. Use .with_monitoring(enabled=False) or OTEL_SDK_DISABLED=true if that is not wanted.

What's Changed

Full Changelog: v2.1.3...v2.2.0