Skip to content
This repository has been archived by the owner on Dec 6, 2024. It is now read-only.

Separate semantic conventions from the specification. #227

Merged
merged 30 commits into from
May 5, 2023
Merged
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
1f41fb5
Separate semantic convention proposal.
jsuereth Mar 20, 2023
732779c
Fixes from review.
jsuereth Mar 21, 2023
e0470a4
Rename file.
jsuereth Mar 21, 2023
efe6ca7
Expand on directory restructuring.
jsuereth Mar 21, 2023
50180cb
Fix spellcheck.
jsuereth Mar 21, 2023
1a50ac5
Fix lint checks.
jsuereth Mar 21, 2023
90cd3c7
Update text/0227-separate-semantic-conventions.md
jsuereth Mar 21, 2023
44bad93
Update text/0227-separate-semantic-conventions.md
jsuereth Mar 21, 2023
912d160
Update text/0227-separate-semantic-conventions.md
jsuereth Mar 21, 2023
8557719
Clarifications to the proposal.
jsuereth Apr 18, 2023
5cdd6d2
Update from discussions.
jsuereth Apr 25, 2023
27f534d
Cleanup errors.
jsuereth Apr 25, 2023
77bb706
Merge branch 'main' into wip-semconv-separate
jsuereth Apr 25, 2023
ff75943
Update text/0227-separate-semantic-conventions.md
jsuereth Apr 28, 2023
8cee4ca
Update text/0227-separate-semantic-conventions.md
jsuereth Apr 28, 2023
8ee43b5
Update text/0227-separate-semantic-conventions.md
jsuereth Apr 28, 2023
c1026c1
Update text/0227-separate-semantic-conventions.md
jsuereth Apr 28, 2023
6a22347
Fixes from review.
jsuereth Apr 28, 2023
84cc07e
Update text/0227-separate-semantic-conventions.md
jsuereth Apr 28, 2023
6433d0a
Update text/0227-separate-semantic-conventions.md
jsuereth Apr 28, 2023
1560851
Update text/0227-separate-semantic-conventions.md
jsuereth Apr 28, 2023
70add2c
Update text/0227-separate-semantic-conventions.md
jsuereth May 3, 2023
5a0542d
Update text/0227-separate-semantic-conventions.md
jsuereth May 3, 2023
d657939
Update text/0227-separate-semantic-conventions.md
jsuereth May 3, 2023
31c450a
Update text/0227-separate-semantic-conventions.md
jsuereth May 3, 2023
ff2e00f
Update text/0227-separate-semantic-conventions.md
jsuereth May 3, 2023
e4fd7da
Update text/0227-separate-semantic-conventions.md
jsuereth May 3, 2023
dc61c3c
Update text/0227-separate-semantic-conventions.md
jsuereth May 3, 2023
09f9088
Move next version number to open question.
jsuereth May 3, 2023
ae976c0
Fix lint checks.
jsuereth May 3, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
182 changes: 182 additions & 0 deletions text/0227-separate-semantic-conventions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,182 @@
# Separate Semantic Conventions

Move Semantic Conventions outside of the main Specifications and version them
separately.

## Motivation

We need to allow semantic conventions to evolve mostly independent of the
overall OpenTelemetry specification. Today, any breaking change in a semantic
convention would require bumping the version number of the entirety of the
OpenTelemetry specification.

## Explanation

A new GitHub repository called `semantic-conventions` would be created in the
OpenTelemetry organization.

This would *initially* have the following structure:

- Boilerplate files, e.g. `README.md`, `LICENSE`, `CODEOWNERS`, `CONTRIBUTING.md`
- `Makefile` that allows automatic generation of documentation from model.
- `semantic_conventions/` The set of YAML files that exist in
`{specification}/semantic_conventions` today.
- `docs/` A new directory that contains human readable documentation for how to
carlosalberto marked this conversation as resolved.
Show resolved Hide resolved
create instrumentation compliant with semantic conventions.
- `resource/` - Contents of `{specification}/resource/semantic_conventions`
- `trace/` - Contents of `{specification}/trace/semantic_conventions`
- `metrics/` - Contents of `{specification}/metrics/semantic_conventions`
- `logs/`- Contents of `{specification}/logs/semantic_conventions`
- `schemas/` - A new location for [Telemetry Schemas](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/schemas/README.md)
to live. This directory will be hosted at
`https://opentelemetry.io/schemas/`

Existing semantic conventions in the specification would be marked as
moved, with documentation denoting the move, but preserving previous contents.
jsuereth marked this conversation as resolved.
Show resolved Hide resolved

Additionally, if the semantic conventions eventually move to domain-specific
directory structure (e.g. `docs/{domain}/README.md`, with trace, metrics, events
in the same file), then this can be refactored in the new repository, preserving
git history.

There will also be the following exceptions in the specification:

- Semantic conventions used to implement API/SDK details will be fully specified in the `opentelemetry-specification` repo
and will not be allowed to change in the Semantic Convention directory.
- Error/Exception handling will remain in the specification.
- SDK configuration interaction w/ semantic convention will remain in the
specification. Specifically `service.name`.
- The specification may elevate some semantic conventions as necessary for
compatibility requirements, e.g. `service.instance.id` and
carlosalberto marked this conversation as resolved.
Show resolved Hide resolved
[Prometheus Compatibility](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/compatibility/prometheus_and_openmetrics.md).
carlosalberto marked this conversation as resolved.
Show resolved Hide resolved

These exceptions exist because:

- Stable portions of the specification already rely on these conventions.
- These conventions are required to implement an SDK today.

As such, the Specification should define the absolute minimum of reserved or
required attribute names and their interaction with the SDK.

## Internal details

The following process would be used to ensure semantic conventions are
seamlessly moved to their new location. This process lists steps in order:

- A moratorium will be placed on Semantic Convention PRs to the specififcation
carlosalberto marked this conversation as resolved.
Show resolved Hide resolved
repository. (Caveat that PRs related to this proposal would be allowed).
carlosalberto marked this conversation as resolved.
Show resolved Hide resolved
- Interactions between Semantic Conventions and the Specification will be
extracted such that the Specification can place requirements on Semantic
Conventions and *normative* specification language will remain in the
core specification directories.
- A new repository `open-telemetry/semantic-conventions` will be constructed with
the proposed format and necessary `Makefile` / tooling.
- The new repository would be created by using `git filter-branch` to preserve
all existing semantic convention history. *This means all existing
semantic conventions will be in the new repository*.
- GitHub Actions, `Makefile` tooling and contributing / readmes would be
updated for the separate repository.
- **Note: At this point, the new location for semantic conventions should
be adoptable/usable.**
- Semantic conventions in the Specification will be marked as moved with
links to the new location.
- The semconv YAML files in the specification repository *will be deleted*.
- All semconv markdown files will be updated such that:
- They no longer generate from YAML files.
- They include a header denoting deprecation and move to the new repository.
- Instrumentation authors will update their code generation to pull from the new
semconv repository instead of the specification repository.

jsuereth marked this conversation as resolved.
Show resolved Hide resolved
## Trade-offs and mitigations

This proposal has a few drawbacks:

- The semantic conventions will no longer be easily referenceable form the specification.
- This is actually a benefit. We can ensure isolation of convention from
specification and require the Specification to use firm language for
attributes it requires, like `service.name`.
- We will provide links from existing location to the new location.
- Semantic Convention version will no longer match the specification version.
jsuereth marked this conversation as resolved.
Show resolved Hide resolved
jsuereth marked this conversation as resolved.
Show resolved Hide resolved
- Instrumentation authors will need to consume a separate semantic-convention
bundle from Specification bundle. What used to be ONE upgrade effort will
tigrannajaryan marked this conversation as resolved.
Show resolved Hide resolved
carlosalberto marked this conversation as resolved.
Show resolved Hide resolved
now be split into two (hopefully smaller) efforts.
carlosalberto marked this conversation as resolved.
Show resolved Hide resolved
- We expect changes from Semantic Conventions and Specification to be
orthogonal, so this should not add significant wall-clock time.
tigrannajaryan marked this conversation as resolved.
Show resolved Hide resolved
- Existing PRs against semantic conventions will need to be regenerated.

Initially this repository would have the following ownership:
jsuereth marked this conversation as resolved.
Show resolved Hide resolved

- Approvers
- [Christian Neumüller](https://github.com/Oberon00), Dynatrace
- [James Moessis](https://github.com/jamesmoessis), Atlassian
- [Joao Grassi](https://github.com/joaopgrassi), Dynatrace
- [Johannes Tax](https://github.com/pyohannes), Microsoft
- [Liudmila Molkova](https://github.com/lmolkova), Microsoft
- [Sean Marcinak](https://github.com/MovieStoreGuy), Atlassian
- [Ted Young](https://github.com/tedsuo), Lightstep
- Approvers (HTTP Only)
- [Trask Stalnaker](github.com/trask)
- Approvers (SchemaUrl Files)
- [Tigran Najaryan](github.com/tigrannajaryan)
- Maintainers
- [Josh Suereth](github.com/jsuereth)
- [Armin Ruech](github.com/arminru)
- [Reiley Yang](github.com/reyang)

That is, Maintenance would initially continue to fall on (a subset of) the
Technical Committee. Approvers would start with existing semconv approvers in
addition to targeted at HTTP semantic convention stability approvers and
expand rapidly as we build momentum on semantic conventions.

## Prior art and alternatives

When we evaluate equivalent communities and efforts we see the following:

- `OpenTracing` - had specification and [semantics](https://github.com/opentracing/specification/blob/master/semantic_conventions.md)
merged.
- `OpenCensus` - had specification and semantics merged. However, OpenCensus
merged with OpenTelemetry prior to mass adoption or stable release of its
specification.
- `Elastic Common Schema` - the schema is its own project / document.
- `Prometheus` - Prometheus does not define rigid guidelines for telemetry, like
semantic conventions, instead relying on naming conventions and
standardization through mass adoption.

## Open questions

This OTEP doesn't address the full needs of tooling and codegen that will be
needed for the community to shift to a separate semantic convention directory.
This will require each SIG that uses autogenerated semantic conventions to
adapt to the new location.

The first version of the new location for semantic conventions may not follow
the latest of the specification. There is reasoning to desire a `2.0` but the
details will be discussed in the new repository location upon execution of this
OTEP.

## Future possibilities

This OTEP paves way for the following desirable features:

- Semantic Conventions can decide to bump major version numbers to accommodate
new signals or hard-to-resolve new domains without breaking the Specification
version number.
- Semantic Conventions can have dedicated maintainers and approvers.
- Semantic Conventions can restructure to better enable subject matter experts
(SMEs) to have approver/CODEOWNER status on relevant directories.
- Semantic Conventions can adopt semantic versioning for itself, helping clearly
denote breaking changes to users.

There is a desire to move semantic conventions to domain-specific directories
instead of signal-specific. This can occur after the separation of the repository
and will be proposed and discussed separately from this OTEP.

For example:

- `docs/`
- `signals/` - Conventions for metrics, traces + logs
- `http/`
- `db/`
- `messaging/`
- `client/`
- `resource/` - We still need resource-specific semantic conventions