Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mdatagen: telemetry attributes #10926

Open
sh0rez opened this issue Aug 20, 2024 · 1 comment
Open

mdatagen: telemetry attributes #10926

sh0rez opened this issue Aug 20, 2024 · 1 comment

Comments

@sh0rez
Copy link
Member

sh0rez commented Aug 20, 2024

In the config spec, mdatagen lists an attributes key for telemetry metrics:

# Optional: array of attributes that were defined in the attributes section that are emitted by this metric.
attributes: [string]

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.

Adding a fake metric to silence the check succeeds, but also does not generate anything.

@codeboten
Copy link
Contributor

I think the same fix that will address #10925 will address this issue as well, can you confirm @sh0rez

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants