Skip to content

Commit 15718c0

Browse files
authored
Separate semantic conventions from the specification. (open-telemetry#227)
1 parent 7ca4b68 commit 15718c0

File tree

1 file changed

+182
-0
lines changed

1 file changed

+182
-0
lines changed
Lines changed: 182 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,182 @@
1+
# Separate Semantic Conventions
2+
3+
Move Semantic Conventions outside of the main Specifications and version them
4+
separately.
5+
6+
## Motivation
7+
8+
We need to allow semantic conventions to evolve mostly independent of the
9+
overall OpenTelemetry specification. Today, any breaking change in a semantic
10+
convention would require bumping the version number of the entirety of the
11+
OpenTelemetry specification.
12+
13+
## Explanation
14+
15+
A new GitHub repository called `semantic-conventions` would be created in the
16+
OpenTelemetry organization.
17+
18+
This would *initially* have the following structure:
19+
20+
- Boilerplate files, e.g. `README.md`, `LICENSE`, `CODEOWNERS`, `CONTRIBUTING.md`
21+
- `Makefile` that allows automatic generation of documentation from model.
22+
- `semantic_conventions/` The set of YAML files that exist in
23+
`{specification}/semantic_conventions` today.
24+
- `docs/` A new directory that contains human readable documentation for how to
25+
create instrumentation compliant with semantic conventions.
26+
- `resource/` - Contents of `{specification}/resource/semantic_conventions`
27+
- `trace/` - Contents of `{specification}/trace/semantic_conventions`
28+
- `metrics/` - Contents of `{specification}/metrics/semantic_conventions`
29+
- `logs/`- Contents of `{specification}/logs/semantic_conventions`
30+
- `schemas/` - A new location for [Telemetry Schemas](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/schemas/README.md)
31+
to live. This directory will be hosted at
32+
`https://opentelemetry.io/schemas/`
33+
34+
Existing semantic conventions in the specification would be marked as
35+
moved, with documentation denoting the move, but preserving previous contents.
36+
37+
Additionally, if the semantic conventions eventually move to domain-specific
38+
directory structure (e.g. `docs/{domain}/README.md`, with trace, metrics, events
39+
in the same file), then this can be refactored in the new repository, preserving
40+
git history.
41+
42+
There will also be the following exceptions in the specification:
43+
44+
- Semantic conventions used to implement API/SDK details will be fully specified in the `opentelemetry-specification` repo
45+
and will not be allowed to change in the Semantic Convention directory.
46+
- Error/Exception handling will remain in the specification.
47+
- SDK configuration interaction w/ semantic convention will remain in the
48+
specification. Specifically `service.name`.
49+
- The specification may elevate some semantic conventions as necessary for
50+
compatibility requirements, e.g. `service.instance.id` and
51+
[Prometheus Compatibility](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/compatibility/prometheus_and_openmetrics.md).
52+
53+
These exceptions exist because:
54+
55+
- Stable portions of the specification already rely on these conventions.
56+
- These conventions are required to implement an SDK today.
57+
58+
As such, the Specification should define the absolute minimum of reserved or
59+
required attribute names and their interaction with the SDK.
60+
61+
## Internal details
62+
63+
The following process would be used to ensure semantic conventions are
64+
seamlessly moved to their new location. This process lists steps in order:
65+
66+
- A moratorium will be placed on Semantic Convention PRs to the specififcation
67+
repository. (Caveat that PRs related to this proposal would be allowed).
68+
- Interactions between Semantic Conventions and the Specification will be
69+
extracted such that the Specification can place requirements on Semantic
70+
Conventions and *normative* specification language will remain in the
71+
core specification directories.
72+
- A new repository `open-telemetry/semantic-conventions` will be constructed with
73+
the proposed format and necessary `Makefile` / tooling.
74+
- The new repository would be created by using `git filter-branch` to preserve
75+
all existing semantic convention history. *This means all existing
76+
semantic conventions will be in the new repository*.
77+
- GitHub Actions, `Makefile` tooling and contributing / readmes would be
78+
updated for the separate repository.
79+
- **Note: At this point, the new location for semantic conventions should
80+
be adoptable/usable.**
81+
- Semantic conventions in the Specification will be marked as moved with
82+
links to the new location.
83+
- The semconv YAML files in the specification repository *will be deleted*.
84+
- All semconv markdown files will be updated such that:
85+
- They no longer generate from YAML files.
86+
- They include a header denoting deprecation and move to the new repository.
87+
- Instrumentation authors will update their code generation to pull from the new
88+
semconv repository instead of the specification repository.
89+
90+
## Trade-offs and mitigations
91+
92+
This proposal has a few drawbacks:
93+
94+
- The semantic conventions will no longer be easily referenceable form the specification.
95+
- This is actually a benefit. We can ensure isolation of convention from
96+
specification and require the Specification to use firm language for
97+
attributes it requires, like `service.name`.
98+
- We will provide links from existing location to the new location.
99+
- Semantic Convention version will no longer match the specification version.
100+
- Instrumentation authors will need to consume a separate semantic-convention
101+
bundle from Specification bundle. What used to be ONE upgrade effort will
102+
now be split into two (hopefully smaller) efforts.
103+
- We expect changes from Semantic Conventions and Specification to be
104+
orthogonal, so this should not add significant wall-clock time.
105+
- Existing PRs against semantic conventions will need to be regenerated.
106+
107+
Initially this repository would have the following ownership:
108+
109+
- Approvers
110+
- [Christian Neumüller](https://github.com/Oberon00), Dynatrace
111+
- [James Moessis](https://github.com/jamesmoessis), Atlassian
112+
- [Joao Grassi](https://github.com/joaopgrassi), Dynatrace
113+
- [Johannes Tax](https://github.com/pyohannes), Microsoft
114+
- [Liudmila Molkova](https://github.com/lmolkova), Microsoft
115+
- [Sean Marcinak](https://github.com/MovieStoreGuy), Atlassian
116+
- [Ted Young](https://github.com/tedsuo), Lightstep
117+
- Approvers (HTTP Only)
118+
- [Trask Stalnaker](github.com/trask)
119+
- Approvers (SchemaUrl Files)
120+
- [Tigran Najaryan](github.com/tigrannajaryan)
121+
- Maintainers
122+
- [Josh Suereth](github.com/jsuereth)
123+
- [Armin Ruech](github.com/arminru)
124+
- [Reiley Yang](github.com/reyang)
125+
126+
That is, Maintenance would initially continue to fall on (a subset of) the
127+
Technical Committee. Approvers would start with existing semconv approvers in
128+
addition to targeted at HTTP semantic convention stability approvers and
129+
expand rapidly as we build momentum on semantic conventions.
130+
131+
## Prior art and alternatives
132+
133+
When we evaluate equivalent communities and efforts we see the following:
134+
135+
- `OpenTracing` - had specification and [semantics](https://github.com/opentracing/specification/blob/master/semantic_conventions.md)
136+
merged.
137+
- `OpenCensus` - had specification and semantics merged. However, OpenCensus
138+
merged with OpenTelemetry prior to mass adoption or stable release of its
139+
specification.
140+
- `Elastic Common Schema` - the schema is its own project / document.
141+
- `Prometheus` - Prometheus does not define rigid guidelines for telemetry, like
142+
semantic conventions, instead relying on naming conventions and
143+
standardization through mass adoption.
144+
145+
## Open questions
146+
147+
This OTEP doesn't address the full needs of tooling and codegen that will be
148+
needed for the community to shift to a separate semantic convention directory.
149+
This will require each SIG that uses autogenerated semantic conventions to
150+
adapt to the new location.
151+
152+
The first version of the new location for semantic conventions may not follow
153+
the latest of the specification. There is reasoning to desire a `2.0` but the
154+
details will be discussed in the new repository location upon execution of this
155+
OTEP.
156+
157+
## Future possibilities
158+
159+
This OTEP paves way for the following desirable features:
160+
161+
- Semantic Conventions can decide to bump major version numbers to accommodate
162+
new signals or hard-to-resolve new domains without breaking the Specification
163+
version number.
164+
- Semantic Conventions can have dedicated maintainers and approvers.
165+
- Semantic Conventions can restructure to better enable subject matter experts
166+
(SMEs) to have approver/CODEOWNER status on relevant directories.
167+
- Semantic Conventions can adopt semantic versioning for itself, helping clearly
168+
denote breaking changes to users.
169+
170+
There is a desire to move semantic conventions to domain-specific directories
171+
instead of signal-specific. This can occur after the separation of the repository
172+
and will be proposed and discussed separately from this OTEP.
173+
174+
For example:
175+
176+
- `docs/`
177+
- `signals/` - Conventions for metrics, traces + logs
178+
- `http/`
179+
- `db/`
180+
- `messaging/`
181+
- `client/`
182+
- `resource/` - We still need resource-specific semantic conventions

0 commit comments

Comments
 (0)