open-telemetry/opentelemetry-ruby-contrib

Implement Semantic Convention Rules for HTTP method

开放

#1,779 创建于 2025年11月6日

 (1 条评论) (0 个反应) (0 位负责人)Ruby (252 个派生)auto 404
help wantedinstrumentation-ethoninstrumentation-exconinstrumentation-faradayinstrumentation-httpinstrumentation-http_clientinstrumentation-httpxinstrumentation-net_httpkeepspec-compliance

仓库指标

星标
 (135 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

[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

贡献者指南