#7438·bifrost

[Bug]: otel HTTP telemetry uses deprecated semconv; no http.route or http.server.request.duration

Author: adjohnCreated Sep 22, 2026Updated Sep 22, 2026

Description

The OTel plugin's HTTP telemetry does not follow the stable OpenTelemetry HTTP semantic conventions, so backends that build service views from those conventions cannot use it.

  • The root HTTP span (transports/bifrost-http/handlers/middlewares.go) sets the deprecated keys http.method, http.url, http.status_code and http.user_agent. It never sets http.route, although the matched route template is already available as BifrostContextKeyHTTPRoute.
  • The pushed OTLP HTTP metrics use Prometheus-style names and labels (http_request_duration_seconds with path, method, status). There is no http.server.request.duration histogram with http.request.method, http.route and http.response.status_code.

Concrete impact: in New Relic, the OpenTelemetry APM Summary page for a Bifrost service shows "Required metrics are missing". New Relic derives that page from http.server.request.duration (or http.server.duration / rpc.server.duration) keyed on http.request.method and http.route. GenAI spans reach New Relic AI Monitoring fine; only the HTTP service view is empty. Grafana, Datadog and other backends that key on the stable HTTP conventions hit the same gap.

Steps to reproduce

  1. Enable the otel plugin with trace_type: genai_extension, metrics_enabled: true, pointed at any OTLP backend.
  2. Send a request to /v1/chat/completions.
  3. Inspect the exported root span and metrics.

Expected behavior

  • Root span carries http.request.method, url.path, http.route (route template), http.response.status_code (int) and user_agent.original.
  • Metrics include http.server.request.duration (unit s) with http.request.method, http.route, http.response.status_code, per HTTP metrics semconv.

Actual behavior

Root span attributes observed on v2.2.1 (captured with a local OTLP sink):

/v1/chat/completions SPAN_KIND_SERVER
  http.method = POST
  http.url = /v1/chat/completions
  http.status_code = 200
  http.user_agent = curl/8.7.1

No http.route, and only the Prometheus-named HTTP metrics are pushed.

Affected area(s)

Plugins (otel), Transports (HTTP)

Version

v2.2.1 (@maximhq/bifrost npx 1.6.3), main at a03cdd2

Regression?

No

Severity

Medium. Tracing works; HTTP service dashboards in semconv-driven backends stay empty.