open-telemetry / semantic-conventions

Defines standards for generating consistent, accessible telemetry across a variety of domains
Apache License 2.0
244 stars 158 forks source link

Semconv schema: formalize registry definition #1269

Open lmolkova opened 1 month ago

lmolkova commented 1 month ago

Today we require all attribute definitions to happen in the registry, i.e. :

We should consider having a more formal way to mark a group as one defining something. E.g.

groups:
- id: foo.bar
  type: attribute_registry <-------- this is new

or

groups:
- id: new-guid
  type: metric_registry <-------- this is new

This would simplify filtering/massaging semconv in code-generation, we'd avoid relying on specific group naming. This would move post-factum policies enforcing attribute definitions into schema validation (id can only appear on *_registry groups and ref cannot appear there).

lmolkova commented 1 month ago

It's a good question if we can reuse existing types (attribute_group, metric, etc) and I believe the answer is no: