open-telemetry/opentelemetry-ruby-contrib

Implement Semantic Convention Rules for HTTP method

Open

#1,779 opened on Nov 6, 2025

View on GitHub
 (1 comment) (0 reactions) (0 assignees)Ruby (252 forks)auto 404
help wantedinstrumentation-ethoninstrumentation-exconinstrumentation-faradayinstrumentation-httpinstrumentation-http_clientinstrumentation-httpxinstrumentation-net_httpkeepspec-compliance

Repository metrics

Stars
 (135 stars)
PR merge metrics
 (PR metrics pending)

Description

[1] http.request.method: HTTP request method value SHOULD be “known” to the instrumentation. By default, this convention defines “known” methods as the ones listed in RFC9110, the PATCH method defined in RFC5789 and the QUERY method defined in httpbis-safe-method-w-body.

If the HTTP request method is not known to instrumentation, it MUST set the http.request.method attribute to _OTHER.

If the HTTP instrumentation could end up converting valid HTTP request methods to _OTHER, then it MUST provide a way to override the list of known HTTP methods. If this override is done via environment variable, then the environment variable MUST be named OTEL_INSTRUMENTATION_HTTP_KNOWN_METHODS and support a comma-separated list of case-sensitive known HTTP methods (this list MUST be a full override of the default known method, it is not a list of known methods in addition to the defaults).

HTTP method names are case-sensitive and http.request.method attribute value MUST match a known HTTP method name exactly. Instrumentations for specific web frameworks that consider HTTP methods to be case insensitive, SHOULD populate a canonical equivalent. Tracing instrumentations that do so, MUST also set http.request.method_original to the original value.

https://opentelemetry.io/docs/specs/semconv/http/http-spans/#http-client-span

Task List

  • Set unknown methods to _OTHER e.g. Fastly purge
    • http
    • http-client
    • httpx
    • faraday
    • net-http
    • ethon
    • excon
    • restclient covered by net::http
  • Add support for OTEL_INSTRUMENTATION_HTTP_KNOWN_METHODS
    • http
    • http-client
    • httpx
    • faraday
    • net-http
    • ethon
    • excon
    • restclient covered by net::http

Contributor guide