Open sh0rez opened 3 weeks ago
In the config spec, mdatagen lists an attributes key for telemetry metrics:
attributes
https://github.com/open-telemetry/opentelemetry-collector/blob/fce1d4619dd65e1c53c0b83ccc154f5063ac8612/cmd/mdatagen/metadata-schema.yaml#L167-L168
however, when trying to use it:
attributes: test: type: string description: test telemetry: metrics: test: description: test unit: "1" enabled: true gauge: value_type: int attributes: [test]
mdatagen fails:
$ go generate . 2024/08/20 16:49:09 failed loading /home/tbraack/work/otelcol-contrib/processor/deltatocumulativeprocessor/metadata.yaml: unused attributes: [test] doc.go:4: running "mdatagen": exit status 1
looking at the code, it appears to only check metrics, not telemetry.metrics for attribute usage.
metrics
telemetry.metrics
Adding a fake metric to silence the check succeeds, but also does not generate anything.
I think the same fix that will address https://github.com/open-telemetry/opentelemetry-collector/issues/10925 will address this issue as well, can you confirm @sh0rez
In the config spec, mdatagen lists an
attributes
key for telemetry metrics:https://github.com/open-telemetry/opentelemetry-collector/blob/fce1d4619dd65e1c53c0b83ccc154f5063ac8612/cmd/mdatagen/metadata-schema.yaml#L167-L168
however, when trying to use it:
mdatagen fails:
looking at the code, it appears to only check
metrics
, nottelemetry.metrics
for attribute usage.Adding a fake metric to silence the check succeeds, but also does not generate anything.