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

貢獻者指南