semantic-conventions/semantic_conventions
Johannes Tax 15f3e529f1 BREAKING: Remove `messaging.consumer.id`, make `messaging.client_id` generic (#3336)
Fixes #2015

## Changes

Based on discussions in the messaging workgroup and in issue #2015, this
PR proposes to remove `messaging.consumer.id`, and to replace both
`messaging.kafka.client_id` and `messaging.rocketmq.client_id` with a
generic `messaging.client_id`.

`messaging.consumer.id` is defined to always be set to the `client_id`
of the used messaging system, except for Kafka, where it was defined to
be a combination of `messaging.kafka.client_id` and
`messaging.kafka.consumer.group`, or just the latter if
`messaging.kafka.client_id` is not available. With this definition, the
semantics of `consumer.id` are different between messaging systems, and
even different for different Kafka scenarios.

The proposed `messaging.client_id` has consistent semantics ("an unique
client id, when it is available"), and can be used instead of
`messaging.consumer.id` in almost all cases.

In addition to have consistent semantics, this also simplifies the
semantic conventions, as instead of

`messaging.consumer.id`
`messaging.kafka.client_id`
`messaging.rocketmq.client_id`

there is now just:

`messaging.client_id`.
2023-04-24 17:13:21 -06:00
..
logs Editorial: add attribute_group type to log.record (#3374) 2023-04-12 11:14:21 -07:00
metrics Fix JVM buffer pool attribute description (#3423) 2023-04-21 09:59:59 -05:00
resource add k8s.cluster.uid resource attribute semconv (#3267) 2023-04-18 15:21:28 -06:00
scope/exporter Define semantic conventions yaml for non-otlp conventions (#2850) 2022-10-25 08:46:06 -07:00
trace BREAKING: Remove `messaging.consumer.id`, make `messaging.client_id` generic (#3336) 2023-04-24 17:13:21 -06:00
README.md Rename Optional attribute requirement level to Opt-In (#3228) 2023-03-01 15:13:24 -08:00
exception.yaml Suggest column # as an extra source code attribute (#3029) 2023-01-02 18:01:32 -06:00
http-common.yaml BREAKING rename `net.app.protocol.(name|version)` to `net.protocol.(name|version)` and replace `http.flavor` with `net.protocol.(name|version)` (#3272) 2023-03-10 10:15:15 -08:00
user-agent.yaml Rename http.user_agent to user_agent.original (#3190) 2023-03-02 14:47:29 -06:00
version.properties YAML Model for Semantic Conventions (#571) 2020-08-27 13:18:51 -07:00

README.md

YAML Model for Semantic Conventions

The YAML descriptions of semantic convention contained in this directory are intended to be used by the various OpenTelemetry language implementations to aid in automatic generation of semantics-related code.

⚠ If you want to read the semantic conventions and not edit them, please see the generated markdown output under /specification/*/semantic_conventions/, i.e.:

Writing semantic conventions

Semantic conventions for the spec MUST adhere to the attribute naming, attribute requirement level, and metric requirement level conventions.

Refer to the syntax 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 for what extension you need.

Generating markdown

These YAML files are used by the make target table-generation to generate consistently formatted Markdown tables for all semantic conventions in the specification. Run it from the root of this repository using the command

make table-generation

For more information, see the semantic convention generator in the OpenTelemetry build tools repository. Using this build tool, it is also possible to generate code for use in OpenTelemetry language projects.

See also: