Skip to content
Merged
Changes from 2 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
01a0019
SemConv schema v2: initial draft
lmolkova Jan 2, 2026
9afa9e9
up
lmolkova Jan 2, 2026
2c6366c
update based on resolved/forge discussion, remove tar.gz
lmolkova Jan 4, 2026
3181bb0
review
lmolkova Jan 12, 2026
d647f8e
add list versions and latest version as future possibilities
lmolkova Jan 13, 2026
95e4d5a
not a goal to decide where individual conventions should live
lmolkova Jan 13, 2026
c5f205e
multi-registry-start
lmolkova Jan 24, 2026
4631056
incorporate Laurent's changes on multi-registry
lmolkova Jan 24, 2026
6bc7c8e
listing versions, publish diff if necessary, scheme url changes
lmolkova Jan 28, 2026
d3b972f
add more context about conflict resolution, other minor cleanup
lmolkova Feb 10, 2026
27d4a1d
link to transform processor PoC
lmolkova Feb 10, 2026
03a47bf
Merge branch 'main' into semconv-schema-v2
lmolkova Feb 10, 2026
c08cca8
lint
lmolkova Feb 10, 2026
f4d5af7
lint
lmolkova Feb 10, 2026
c054320
adapt to https://github.com/open-telemetry/weaver/pull/1202 refactorings
lmolkova Feb 15, 2026
8e672e1
address feedback
lmolkova Feb 15, 2026
0e82317
more cleanup and feedback
lmolkova Feb 15, 2026
eb43a7c
unify file_format versioning across manifest/resolved/definition
lmolkova Apr 27, 2026
ab4927b
rename resolved_schema_uri to resolved_registry_uri
lmolkova Apr 27, 2026
6684e6d
address some of the feedback
lmolkova Apr 27, 2026
5788fcf
Merge branch 'main' into semconv-schema-v2
lmolkova Apr 27, 2026
da10539
address another batch
lmolkova Apr 28, 2026
b7436b2
move -dev from version suffix to family suffix
lmolkova Apr 28, 2026
9d41e1c
move sections around, no change
lmolkova Apr 28, 2026
5d51087
fix lint
lmolkova Apr 28, 2026
0910610
nits
lmolkova Apr 28, 2026
8137e9f
Merge branch 'main' into semconv-schema-v2
lmolkova May 8, 2026
1281ddd
add prerelease prefix on schema url
lmolkova May 8, 2026
bab8479
Merge branch 'main' into semconv-schema-v2
lmolkova May 17, 2026
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
320 changes: 320 additions & 0 deletions oteps/4815-semantic-conventions-schema-v2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,320 @@
# Semantic Convention Schema v2

<!-- toc -->

- [Motivation](#motivation)
- [Details](#details)
- [Resolved schema](#resolved-schema)
- [Do we need to talk about importing and decentralization in details?](#do-we-need-to-talk-about-importing-and-decentralization-in-details)
- [Differentiating between stable and not stable schemas](#differentiating-between-stable-and-not-stable-schemas)
- [Trade-offs and mitigations](#trade-offs-and-mitigations)
- [Schema Transformation](#schema-transformation)
- [Documentation and code generation](#documentation-and-code-generation)
- [Prior art and alternatives](#prior-art-and-alternatives)
- [Open questions](#open-questions)
- [Schema processing evolution](#schema-processing-evolution)
- [Prototypes](#prototypes)
- [Future possibilities](#future-possibilities)

<!-- tocstop -->

In this OTEP, we propose a new telemetry schema format that supports multiple convention registries
and provides full access to metadata.

It's built upon and is aligned with [OTEP 0243 - Introducing Application Telemetry Schema in OpenTelemetry - Vision and Roadmap](/oteps/0243-app-telemetry-schema-vision-roadmap.md)

## Motivation

Semantic Conventions describe telemetry schema. Conventions hosted by OpenTelemetry describe
common concepts like HTTP and telemetry produced by different OTel instrumentations.

OTel collector and language-specific instrumentations should be able to publish their
own conventions that are only applicable within their ecosystem, and should
have means to communicate the schema they use with [Schema URL](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.52.0/specification/schemas/README.md#schema-url).
Comment thread
lmolkova marked this conversation as resolved.
Outdated

Instrumentations that are not hosted by OTel should be able to document and publish
their own conventions that may take a dependency on the OTel ones.

Consumers of telemetry should be able to access the full schema to validate, upgrade,
refine, or sanitize the telemetry. The fully resolved schema, discoverable using
Comment thread
lmolkova marked this conversation as resolved.
Outdated
Schema URL, serves as an additional channel for metadata about telemetry. This approach
does not increase telemetry volume and associated costs.

Examples:

- Given a telemetry signal, consumer should be able to find the full definition
of the corresponding telemetry item. This enables quite a few use cases:
- UX hints and AI-assistants (explain what this metric measures or what this attribute means)
- validation (does the telemetry item comply with the schema)
- cost-saving (drop all non-essential metrics)
- sanitization (based on annotations in the schema, redact potentially sensitive data)
- Document company/service-specific conventions taking OTel ones as a dependency
and make their schemas accessible to consumers.
See [OTEP 0243](/oteps/0243-app-telemetry-schema-vision-roadmap.md) for the details

[Telemetry Schema](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.52.0/specification/schemas/README.md)
has built the foundation for these scenarios, but does not fully support them -
it's designed around schema transformations and describes diff between schema
versions such as attribute or metric renames. While it can work under the assumption
that there is a single registry (OpenTelemetry Semantic Conventions), it needs
an upgrade to support arbitrary convention registries.

## Details

When an HTTP GET is issued against a valid Schema URL, the service hosting that
Schema URL SHOULD return a valid *manifest* in response.

Here's an example of the *manifest* returned in response:

```yaml
file_format: 2.0.0
Comment thread
lmolkova marked this conversation as resolved.
Outdated
Comment thread
lmolkova marked this conversation as resolved.
Outdated
name: open-telemetry
Comment thread
lmolkova marked this conversation as resolved.
Outdated
description: OpenTelemetry Semantic Conventions
version: 1.39.0
repository_url: https://github.com/open-telemetry/semantic-conventions
stability: development
resolved_schema_url: https://github.com/open-telemetry/semantic-conventions/archive/refs/tags/schema-v1.39.0-dev.tar.gz

Comment thread
lmolkova marked this conversation as resolved.
# future
# minified_schema_url: https://github.com/open-telemetry/semantic-conventions/archive/refs/tags/schema-v1.39.0-dev.minified.tar.gz
# diff_url: ...
# all_in_one_url: https://github.com/open-telemetry/semantic-conventions/archive/refs/tags/v1.39.0-dev.tar.gz
```
Comment thread
lmolkova marked this conversation as resolved.

The manifest contains metadata about the semantic convention registry including its
version, stability, and `resolved_schema_url`.

The `resolved_schema_url` MUST point to a valid `tar.gz` archive containing one YAML file
Comment thread
lmolkova marked this conversation as resolved.
Outdated
with the [*resolved* schema](#resolved-schema).

The manifest format will evolve. For example, we may add a minified version of resolved schema
Comment thread
lmolkova marked this conversation as resolved.
Outdated
to optimize its volume and publish resolved schema along with its minified version.
Consumers can decide to download only the parts they actually use.

Artifacts for a given release MUST be immutable. Consumers SHOULD make best efforts
to cache manifests and resolved schemas or any parts of them used on the hot path.

The manifest schema and REST API to obtain it using Schema URL will be formally
documented for public, unauthenticated access.

See [Differentiating between stable and not stable schemas](#differentiating-between-stable-and-not-stable-schemas)
for details on the `-dev` suffix.

### Resolved schema

The [*source* schema](https://github.com/open-telemetry/weaver/blob/main/schemas/semconv-syntax.v2.md)
used to write semantic conventions is not the same as *resolved* schema.

For example, a metric could be defined in the following way in the *source* schema:

```yaml
# source schema
metrics:
- name: my.client.operation.duration
stability: stable
instrument: histogram
unit: s
attributes:
- ref: server.address
- ref: server.port
- ref: error.type
- ref: my.operation.name
```

Attributes are defined separately from metrics and are referenced,
optimizing reusability and consistency. Defaults or inherited properties are
omitted.

*Resolved* schema for this metric is self-sufficient and includes all properties
that were defaulted or inherited:

```yaml
# resolved schema
metrics:
- name: my.client.operation.duration
instrument: histogram
unit: s
attributes:
- key: my.operation.name
brief: My service operation name as defined in this Open API spec
stability: stable
requirement_level: required
type:
members:
- id: get_my_order
...
- id: create_my_order
...
- key: server.address
type: string
brief: My server host name
...
examples: ["us-west-prod.my.com"]
requirement_level: recommended
...
```

Resolved schema will be formally documented as [JSON schema](https://github.com/lmolkova/weaver/blob/6e17fc0ca6d52f60e56cd94a2783c22d9ec5dc5b/schemas/semconv.resolved-schema.v2.json), see [overview](https://github.com/lmolkova/weaver/blob/6e17fc0ca6d52f60e56cd94a2783c22d9ec5dc5b/schemas/semconv-schemas.md#resolved-schema).

Only the *resolved* schema should be published; the original semantic convention
source definitions are considered internal to that registry.

Volume data point: resolved schema for [OTel Semantic Conventions v1.38.0](https://github.com/open-telemetry/semantic-conventions/releases/tag/v1.38.0)
is estimated around 3MB uncompressed and around 350KB compressed.

### Differentiating between stable and not stable schemas

Currently, Schema URL includes semantic convention version, but does not include
indication of stability.

In addition to the version, we will leverage [SemVer pre-release](https://semver.org/#spec-item-9)
syntax to communicate the stability of the conventions and telemetry.

OpenTelemetry Semantic Conventions will publish two versions with each release:
Comment thread
lmolkova marked this conversation as resolved.
Outdated

- stable (e.g. `https://opentelemetry.io/schemas/1.42.0`) which will include only
a stable subset of semantic conventions
- development (e.g. `https://opentelemetry.io/schemas/1.42.0-dev`) which will
include all semantic conventions defined in the registry regardless of their
stability

Manifest file MUST include actual stability level.

OpenTelemetry instrumentation SHOULD provide a Schema URL depending on which version
of conventions they follow.

For example, when HTTP instrumentation supports experimental features available
on top of HTTP conventions, and user enabled these experimental features, instrumentation
should specify a `-dev` Schema URL.

### Do we need to talk about importing and decentralization in details?

TODO
Comment thread
lmolkova marked this conversation as resolved.
Outdated

## Trade-offs and mitigations

> [!NOTE]
>
> We will stop publishing current schema [file format 1.1.0](/specification/schemas/file_format_v1.1.0.md)
> which has [Development](/specification/document-status.md) status
>
> This is a breaking change for:
>
> - schema transformation (collector `schemaprocessor`)
> - documentation and code generation scripts

Consumers that download content of Schema URL today will start receiving new
file format that they won't recognize and won't be able to perform their scenarios.

The only user of existing schema files we are aware of is [schemaprocessor](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/schemaprocessor), which was partially implemented ~1 year ago to do schema transformations,
but has not been included in OTel collector distribution.

### Schema Transformation

Schema transformations (diffs) will not be published due to:

- limited adoption and functionality not covering many existing upgrade cases
- ability to generate them on demand
Comment thread
lmolkova marked this conversation as resolved.
Outdated

While it's possible to publish old schema side-by-side with a new one, it would mean
using a different URL format (such as `https://opentelemetry.io/schemas/v2/1.42.0`)
which would be confusing. More importantly, we believe it's not justified taking into
Comment thread
lmolkova marked this conversation as resolved.
Outdated
account actual usage.

In order to perform schema transformations, schema processor and other possible consumers
are encouraged to use [`weaver registry diff`](https://github.com/open-telemetry/weaver/blob/main/docs/usage.md#registry-diff)
to pre-generate at start time (or generate lazily at runtime) the list of diffs
for versions they want to support such as vN -> vTarget, vN+1 -> vTarget, etc:

```bash
weaver registry diff \
--registry ./schema-v1.38.0-dev \
Comment thread
lmolkova marked this conversation as resolved.
Outdated
--baseline-registry ./schema-v1.28.0-dev \
--diff-format yaml \
--output diff_v1.28.0_v1.38.0 \
--v2
```

It produces a diff file similar to:

```yaml
registry:
attribute_changes:
- name: system.memory.linux.slab.state
type: added
- new_name: rpc.response.status_code
note: Replaced by `rpc.response.status_code`.
old_name: rpc.connect_rpc.error_code
type: renamed
...
```

Diff schema is formally documented as JSON schema, see [overview](https://github.com/lmolkova/weaver/blob/6e17fc0ca6d52f60e56cd94a2783c22d9ec5dc5b/schemas/semconv-schemas.md#diff-schema)
and [full schema](https://github.com/lmolkova/weaver/blob/6e17fc0ca6d52f60e56cd94a2783c22d9ec5dc5b/schemas/semconv.diff.v2.json).

<details>

<summary>It's relatively cheap to calculate the diff between two arbitrary (supported by weaver)
versions.</summary>

Assuming data is already available locally, it takes ~100ms and ~500ms on two different
Comment thread
lmolkova marked this conversation as resolved.
Outdated
machines I tried. It currently includes time to unpack, read, validate, and
resolve source schema, and can be optimized further by leveraging resolved schema.
</details>

### Documentation and code generation

Weaver supports Schema V2 as opt-in feature and will default to old schema formats
until a majority of OTel code-generation scripts use it.

Migration will involve minor changes in Jinja templates and weaver config files.
Migration steps and recipes will be documented. There should be no impact on the
generated documentation or artifacts affecting end users.

## Prior art and alternatives

See [Telemetry Schema](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.52.0/specification/schemas/README.md)
for the current state of the art.

## Open questions

### Schema processing evolution

Based on the previous discussions in the community ([weaver/450](https://github.com/open-telemetry/weaver/issues/450),
[repo:open-telemetry/opentelemetry-specification schema transformation](https://github.com/search?q=repo%3Aopen-telemetry%2Fopentelemetry-specification+schema+transformation&type=issues)) we've identified
that the need for transformations is not limited to renames. Applying certain
transformations in isolation may produce otherwise invalid
telemetry items (e.g. renaming existing attribute but not adding new required attribute).
Transformations need to support upgrades and downgrades.
So while transformations are extremely useful, they could be extremely complicated.

The existing story around schema transformations didn't go through extensive development
and feedback cycle and we don't have confidence that weaver diff schema is sufficient
for the future transformation needs. It's also not clear if schema transformation
Comment thread
jsuereth marked this conversation as resolved.
Outdated
would still be necessary once the core set of semantic conventions is stabilized.

Weaver diff should evolve along with schema transformation adoption and eventually
may be included in the published artifacts.

## Prototypes

[Semantic conventions](https://github.com/open-telemetry/semantic-conventions/pull/2469)
in a release preparation step would:

- resolve schema
- generate manifest
- publish SemConv artifact as a GitHub release asset (and potentially on opentelemetry.io)
- TODO: stable and not stable publishing

TODO: do we need collector prototype for schema transformation?
Comment thread
lmolkova marked this conversation as resolved.
Outdated
TODO: do we need imports/decentralized example

## Future possibilities

1. Schema transformation may be applicable between different convention registries.
For example, between ECS and OTel or between [OTel gRPC and native gRPC conventions](https://github.com/open-telemetry/semantic-conventions/pull/3229)

2. We've been serving OTel schemas on opentelemetry.io and are proposing to start
serving artifacts from GitHub assets. If we see significantly higher demand,
we'd need to consider other distribution options that would support scale or
reliability needs.
Loading