Skip to content

Implement Semantic Convention Rules for HTTP method #1779

@arielvalentin

Description

@arielvalentin

[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

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is neededkeepEnsures stale-bot keeps this issue/PR openspec-complianceRequired for OpenTelemetry spec compliance

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions