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] validateAttributes func should alos consider check attributes used in telemetry section #10925

Closed
Frapschen opened this issue Aug 20, 2024 · 0 comments · Fixed by #10942
Labels
bug Something isn't working

Comments

@Frapschen
Copy link
Contributor

Describe the bug

The below metadata.yaml will encounter an error unused attributes: [unused_attr used_attr]:

type: metricreceiver

sem_conv_version: 1.9.0

status:
  class: receiver
  stability:
    development: [logs]
    beta: [traces]
    stable: [metrics]

attributes:
  used_attr:
    description: Used attribute.
    type: string

  unused_attr:
    name_override: state
    description: Unused attribute.
    type: string

telemetry:
  metrics:
    test:
      enabled: true
      description: Metric.
      unit: "1"
      gauge:
        value_type: double
      attributes: [used_attr]

I believe the used_attr is already used in the telemetry section.

@Frapschen Frapschen added the bug Something isn't working label Aug 20, 2024
codeboten added a commit that referenced this issue Sep 12, 2024
…10942)

#### Description

I have a use case, I define an attribute and try to use it in
`telemetry.metric` however I encounter an error: `unused attributes:
[xxx]`
So, I push this PR to enhance the `validateMetrics()` func to support
validate metrics in `telemetry.metric`

#### Link to tracking issue fix
Fixes #10925

---------

Co-authored-by: Alex Boten <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
1 participant