[Bug]: otel HTTP telemetry uses deprecated semconv; no http.route or http.server.request.duration
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 keyshttp.method,http.url,http.status_codeandhttp.user_agent. It never setshttp.route, although the matched route template is already available asBifrostContextKeyHTTPRoute. - The pushed OTLP HTTP metrics use Prometheus-style names and labels (
http_request_duration_secondswithpath,method,status). There is nohttp.server.request.durationhistogram withhttp.request.method,http.routeandhttp.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
- Enable the otel plugin with
trace_type: genai_extension,metrics_enabled: true, pointed at any OTLP backend. - Send a request to
/v1/chat/completions. - 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) anduser_agent.original. - Metrics include
http.server.request.duration(units) withhttp.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.1No 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.
Source: maximhq/bifrost