[mdatagen] Add semconv reference for attributes in metadata schema#14646
Conversation
This update to mdatagen allows attributes and resource attributes to reference their semantic convention, this is then included in the generated documentation.
Codecov Report❌ Patch coverage is ❌ Your patch status has failed because the patch coverage (65.89%) is below the target coverage (95.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #14646 +/- ##
==========================================
- Coverage 91.32% 91.22% -0.11%
==========================================
Files 697 697
Lines 44456 44624 +168
==========================================
+ Hits 40601 40707 +106
- Misses 2716 2773 +57
- Partials 1139 1144 +5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
The metdata schema has been updated to use relative url refs for linking attributes and metrics to their semantic-conventions. mdatagen now builds the url using the semantic-conventions version of the schema.
ChrsMark
left a comment
There was a problem hiding this comment.
I think that addition will be helpful at the moment to link existing attributes to defined Semantic Conventions.
I would like to use this already in https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/processor/k8sattributesprocessor/documentation.md as part of open-telemetry/opentelemetry-collector-contrib#44483.
This comment was marked as outdated.
This comment was marked as outdated.
mx-psi
left a comment
There was a problem hiding this comment.
LGTM, ready to merge once the CI is fixed
6a56478
Description
This PR adds support in mdatagen for defining semantic conventions references for attributes.
Updating your attribute in
metadata.yaml:Important
This work also updates the
semantic_convention: ref:to use a relative URL, this was done as we want to ensure the same semconv version from the metadata schema is used, otherwise the end user could have a full url inrefwith one semconv version and the schema version being a different version. A new method has been introduced in mdatagen that builds the semconv url at runtime.Creates this table in the generated docs for that component:
Attributes
buffered,cached,inactive,free,slab_reclaimable,slab_unreclaimable,usedLink to tracking issue
This work is linked to #13297 but doesn't close it.
Testing
cpuandstate.cmd/mdatagen/internal/samplerecieverwas updated and generate code created which creates tests.Documentation
The documentation template has been updated to reference the semconv definition for attributes if provided in the schema.