Skip to content

Commit

Permalink
use original method as HTTP span name
Browse files Browse the repository at this point in the history
  • Loading branch information
lmolkova committed Aug 17, 2023
1 parent 098db1c commit daf44a4
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions docs/http/http-spans.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,20 @@ and various HTTP versions like 1.1, 2 and SPDY.
## Name

HTTP spans MUST follow the overall [guidelines for span names](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.22.0/specification/trace/api.md#span).
HTTP server span names SHOULD be `{http.request.method} {http.route}` if there is a

HTTP server span names SHOULD be `{method} {http.route}` if there is a
(low-cardinality) `http.route` available.
HTTP server span names SHOULD be `{http.request.method}` if there is no (low-cardinality)
`http.route` available.

If there is no (low-cardinality) `http.route` available, HTTP server span names
SHOULD match `{method}`

HTTP client spans have no `http.route` attribute since client-side instrumentation
is not generally aware of the "route", and therefore HTTP client spans SHOULD use
`{http.request.method}`.
is not generally aware of the "route", and therefore HTTP client spans SHOULD be
`{method}`.

The `{method}` in all cases SHOULD be `{http.request.method_original}` when the original method
is available and `{http.request.method}` otherwise.

Instrumentation MUST NOT default to using URI
path as span name, but MAY provide hooks to allow custom logic to override the
default span name.
Expand Down

0 comments on commit daf44a4

Please sign in to comment.