Skip to content

[FEATURE] OTLP metrics exporter #842

Closed

Description

@edenreich

Problem

Self-hosters running the inference-gateway stack want CLI metrics in their existing observability stack (Prometheus/Grafana via an OpenTelemetry collector), not only local infer stats.

Design

Optional OTLP metric exporter behind metrics.otlp.{endpoint, headers, interval} (inactive when endpoint is empty — no otel SDK initialization). The exporter is a second sink on the recorder's event stream, not a second instrumentation pass. Mapping:

  • infer.tool.calls counter, attrs {tool, outcome}
  • infer.tool.duration histogram, attrs {tool}
  • infer.tokens counter, attrs {model, direction}
  • infer.sessions counter, attrs {mode}

Use the otel-go SDK meter provider with a periodic reader; flush on shutdown.

Acceptance criteria

  • Metrics visible via a local otel-collector debug exporter; example collector config in docs
  • No otel dependency initialized when the endpoint is unset
  • Exporter failures never affect CLI operation (log-and-drop)

Dependencies

Depends on #841 (the recorder and its event stream).

Activity

  1. added
    enhancement
    on Jul 10, 2026
  2. moved this to Todo in 2026on Jul 10, 2026
  3. added a commit that references this issue on Jul 12, 2026
    a0ad20c
  4. moved this from Todo to Done in 2026on Jul 12, 2026
  5. inference-gateway-releaser commented on Jul 12, 2026

    @inference-gateway-releaser
    Contributor

    🎉 This issue has been resolved in version 0.145.0 🎉

    The release is available on:

    Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementreleased

    Projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions