Skip to content

[mdatagen] templates not rendering correctly when running against v0.120.0 of mdatagen #12455

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

Closed
adrielp opened this issue Feb 21, 2025 · 1 comment · Fixed by #12456
Closed
Labels
bug Something isn't working cmd/mdatagen

Comments

@adrielp
Copy link
Contributor

adrielp commented Feb 21, 2025

Component(s)

cmd/mdatagen

What happened?

Describe the bug

When updating mgdatagen to v0.120.0 in downstream Otel collector distributions with custom components, mdatagen generates metrics missing import statements for components with resource attributes.

filter package has been removed but is still required when emitting metrics with resource attributes. This appears to be a regression within this commit

Image

Steps to reproduce

Create a metrics receiver that defines resource attributes and run generate.

What did you expect to see?

  • Expected to see working generated components

What did you see instead?

  • Non-working generated components

Collector version

v0.120.0

Environment information

Environment

OS: Darwin arm64
Compiler(if manually compiled): go 1.23*

OpenTelemetry Collector configuration

Log output

Additional context

No response

@adrielp adrielp added the bug Something isn't working label Feb 21, 2025
Copy link
Contributor

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

github-merge-queue bot pushed a commit that referenced this issue Feb 21, 2025
…#12456)

#### Description

Re-adds the missing import for the `ResourceAttributes` for metrics
generation. This impacts receivers that emit resource attributes. Filter
is still within the template code for resource attributes, but not
imported.

#### Link to tracking issue
Fixes #12455
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cmd/mdatagen
Projects
None yet
1 participant