From f003d4fdc23b8cbac2466ee76b7f59d586c3e251 Mon Sep 17 00:00:00 2001 From: Armin Ruech Date: Tue, 24 Jan 2023 17:52:53 +0100 Subject: [PATCH] Enable semantic convention tooling for metrics (#3119) --- .vscode/settings.json | 2 +- CHANGELOG.md | 2 ++ Makefile | 2 +- semantic_conventions/README.md | 6 +++--- specification/trace/semantic_conventions/http.md | 8 ++++---- 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index aacbf2968fd..1346afcd11f 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -10,7 +10,7 @@ "MD040": false, }, "yaml.schemas": { - "https://raw.githubusercontent.com/open-telemetry/build-tools/v0.14.0/semantic-conventions/semconv.schema.json": [ + "https://raw.githubusercontent.com/open-telemetry/build-tools/v0.15.1/semantic-conventions/semconv.schema.json": [ "semantic_conventions/**/*.yaml" ] }, diff --git a/CHANGELOG.md b/CHANGELOG.md index e6b38dc03cd..5304ace65bd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,8 @@ release. ### Semantic Conventions +- Enable semantic convention tooling for metrics in spec + ([#3119](https://github.com/open-telemetry/opentelemetry-specification/pull/3119)) - Rename google openshift platform attribute from `google_cloud_openshift` to `gcp_openshift` to match the existing `cloud.provider` prefix. [#3095](https://github.com/open-telemetry/opentelemetry-specification/pull/3095) diff --git a/Makefile b/Makefile index 4a7ae02f170..8e3d033f1c9 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,7 @@ MISSPELL = $(TOOLS_DIR)/$(MISSPELL_BINARY) # see https://github.com/open-telemetry/build-tools/releases for semconvgen updates # Keep links in semantic_conventions/README.md and .vscode/settings.json in sync! -SEMCONVGEN_VERSION=0.14.0 +SEMCONVGEN_VERSION=0.15.1 # TODO: add `yamllint` step to `all` after making sure it works on Mac. .PHONY: all diff --git a/semantic_conventions/README.md b/semantic_conventions/README.md index 7e7ea5d2ba7..ef7887420f7 100644 --- a/semantic_conventions/README.md +++ b/semantic_conventions/README.md @@ -17,12 +17,12 @@ i.e.: Semantic conventions for the spec MUST adhere to the [attribute naming](../specification/common/attribute-naming.md) and [requirement level](../specification/common/attribute-requirement-level.md) conventions. -Refer to the [syntax](https://github.com/open-telemetry/build-tools/tree/v0.14.0/semantic-conventions/syntax.md) +Refer to the [syntax](https://github.com/open-telemetry/build-tools/tree/v0.15.1/semantic-conventions/syntax.md) for how to write the YAML files for semantic conventions and what the YAML properties mean. A schema file for VS code is configured in the `/.vscode/settings.json` of this repository, enabling auto-completion and additional checks. Refer to -[the generator README](https://github.com/open-telemetry/build-tools/tree/v0.14.0/semantic-conventions/README.md) for what extension you need. +[the generator README](https://github.com/open-telemetry/build-tools/tree/v0.15.1/semantic-conventions/README.md) for what extension you need. ## Generating markdown @@ -33,7 +33,7 @@ formatted Markdown tables for all semantic conventions in the specification. Run make table-generation ``` -For more information, see the [semantic convention generator](https://github.com/open-telemetry/build-tools/tree/v0.14.0/semantic-conventions) +For more information, see the [semantic convention generator](https://github.com/open-telemetry/build-tools/tree/v0.15.1/semantic-conventions) in the OpenTelemetry build tools repository. Using this build tool, it is also possible to generate code for use in OpenTelemetry language projects. diff --git a/specification/trace/semantic_conventions/http.md b/specification/trace/semantic_conventions/http.md index 794784228f2..eaa2e5ec40f 100644 --- a/specification/trace/semantic_conventions/http.md +++ b/specification/trace/semantic_conventions/http.md @@ -86,6 +86,10 @@ sections below. **[4]:** If defined for the address family and if different than `net.peer.port` and if `net.sock.peer.addr` is set. +Following attributes MUST be provided **at span creation time** (when provided at all), so they can be considered for sampling decisions: + +* `http.method` + `http.flavor` has the following list of well-known values. If one of them applies, then the respective value MUST be used, otherwise a custom value MAY be used. | Value | Description | @@ -96,10 +100,6 @@ sections below. | `3.0` | HTTP/3 | | `SPDY` | SPDY protocol. | | `QUIC` | QUIC protocol. | - -Following attributes MUST be provided **at span creation time** (when provided at all), so they can be considered for sampling decisions: - -* `http.method` It is recommended to also use the general [socket-level attributes][] - `net.sock.peer.addr` when available, `net.sock.peer.name` and `net.sock.peer.port` when don't match `net.peer.name` and `net.peer.port` (if [intermediary](https://www.rfc-editor.org/rfc/rfc9110.html#section-3.7) is detected).