Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BREAKING: Limit HTTP method values to closed set (for cardinality reason) #3478

Closed
wants to merge 17 commits into from
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@ release.
`http.scheme` to `url.scheme`,
and removes `http.target` breaking it down to `http.target` to `url.path`, `url.query`, and `url.fragment`.
([#3355](https://github.com/open-telemetry/opentelemetry-specification/pull/3355))

- BREAKING: Limit `http.request.method` values to a closed set of known values
([#3478](https://github.com/open-telemetry/opentelemetry-specification/pull/3478))

### Compatibility

### Supplemenatary Guidelines
Expand Down
49 changes: 48 additions & 1 deletion semantic_conventions/http-common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,57 @@ groups:
prefix: http
attributes:
- id: request.method
type: string
type:
allow_custom_values: true
members:
- id: connect
value: "CONNECT"
brief: 'CONNECT method.'
- id: delete
value: "DELETE"
brief: 'DELETE method.'
- id: get
value: "GET"
brief: 'GET method.'
- id: head
value: "HEAD"
brief: 'HEAD method.'
- id: options
value: "OPTIONS"
brief: 'OPTIONS method.'
- id: patch
value: "PATCH"
brief: 'PATCH method.'
- id: post
value: "POST"
brief: 'POST method.'
- id: put
value: "PUT"
brief: 'PUT method.'
- id: trace
value: "TRACE"
brief: 'TRACE method.'
- id: other
value: "OTHER"
lmolkova marked this conversation as resolved.
Show resolved Hide resolved
brief: 'Any custom HTTP method that the instrumentation has no prior knowledge of.'
requirement_level: required
brief: 'HTTP request method.'
examples: ["GET", "POST", "HEAD"]
note: |
HTTP request method SHOULD be one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods)
or the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html).
Instrumentation MAY additionally support the closed set of custom HTTP methods defined in
[HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry.
If the HTTP request method is not known to the instrumentation, it MUST set the `http.request.method` attribute to `OTHER` and SHOULD
populate the exact method passed by client on `http.request.original_method` attribute.

HTTP method names are case-sensitive and `http.request.method` attribute value MUST match a standard (or documented elsewhere) HTTP method name exactly.
- id: request.original_method
type: string
requirement_level:
recommended: If and only if it's different than `http.request.method`.
brief: Original HTTP method sent by the client in the request line.
examples: ["GeT", "ACL", "foo"]
- id: response.status_code
type: int
requirement_level:
Expand Down
Loading