Use `HTTP` instead of `_OTHER` in HTTP span names (if method is unknown) (#270)

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
Co-authored-by: Joao Grassi <joao@joaograssi.com>
Co-authored-by: Christian Neumüller <christian+github@neumueller.me>
Co-authored-by: Armin Ruech <armin.ruech@dynatrace.com>
This commit is contained in:
Liudmila Molkova 2023-09-11 08:19:57 -07:00 committed by GitHub
parent 3e16365a27
commit 5f6558d259
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 7 deletions

View File

@ -65,6 +65,8 @@ release.
([#276](https://github.com/open-telemetry/semantic-conventions/pull/276)) ([#276](https://github.com/open-telemetry/semantic-conventions/pull/276))
- Add host cpu resource attributes. - Add host cpu resource attributes.
([#209](https://github.com/open-telemetry/semantic-conventions/pull/209)) ([#209](https://github.com/open-telemetry/semantic-conventions/pull/209))
- BREAKING: Change HTTP span name when method is unknown (use `HTTP` instead of `_OTHER`)
([#270](https://github.com/open-telemetry/semantic-conventions/pull/270))
- Moved RPC streaming notes from metric brief section to notes section. - Moved RPC streaming notes from metric brief section to notes section.
([#275](https://github.com/open-telemetry/semantic-conventions/pull/275)) ([#275](https://github.com/open-telemetry/semantic-conventions/pull/275))

View File

@ -62,13 +62,23 @@ and various HTTP versions like 1.1, 2 and SPDY.
## Name ## 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 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
(low-cardinality) `http.route` available. <!-- markdown-link-check-disable -->
HTTP server span names SHOULD be `{http.request.method}` if there is no (low-cardinality) <!-- HTML anchors are not supported https://github.com/tcort/markdown-link-check/issues/225-->
`http.route` available. HTTP server span names SHOULD be `{method} {http.route}` if there is a
(low-cardinality) `http.route` available (see below for the exact definition of the [`{method}`](#method-placeholder) placeholder).
If there is no (low-cardinality) `http.route` available, HTTP server span names
SHOULD be [`{method}`](#method-placeholder).
HTTP client spans have no `http.route` attribute since client-side instrumentation 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 is not generally aware of the "route", and therefore HTTP client spans SHOULD be
`{http.request.method}`. [`{method}`](#method-placeholder).
<!-- markdown-link-check-enable -->
The <span id="method-placeholder">`{method}`</span> MUST be `{http.request.method}` if the method represents the original method known to the instrumentation.
In other cases (when `{http.request.method}` is set to `_OTHER`), `{method}` MUST be `HTTP`.
Instrumentation MUST NOT default to using URI Instrumentation MUST NOT default to using URI
path as span name, but MAY provide hooks to allow custom logic to override the path as span name, but MAY provide hooks to allow custom logic to override the
default span name. default span name.

View File

@ -11,7 +11,7 @@
"devDependencies": { "devDependencies": {
"gulp": "^4.0.2", "gulp": "^4.0.2",
"js-yaml": "^4.1.0", "js-yaml": "^4.1.0",
"markdown-link-check": "3.10.3", "markdown-link-check": "^3.11.2",
"markdown-toc": "^1.2.0", "markdown-toc": "^1.2.0",
"markdownlint": "^0.29.0", "markdownlint": "^0.29.0",
"markdownlint-cli": "0.31.0", "markdownlint-cli": "0.31.0",