Skip to content

Conversation

@mdonkers
Copy link
Contributor

@mdonkers mdonkers commented Sep 3, 2025

Description

Fixes issue #42232
By no longer adding Metric Labels from the source metric, to the target Resource Attributes.
Instead for every metric, add the Labels as Metric Attributes (which was happening for 'histograms' already)

Link to tracking issue

Fixes #42232

Testing

As there was only a test for gauges, I extended it to validate attributes are correctly converted.

@mdonkers mdonkers requested review from a team, TylerHelmuth and dashpole as code owners September 3, 2025 18:43
@mdonkers mdonkers changed the title Correctly add Metric Labels as Metric Attributes in OTel, not as Resource Attributes [chore] Correctly add Metric Labels as Metric Attributes in OTel, not as Resource Attributes Sep 3, 2025
@mdonkers mdonkers changed the title [chore] Correctly add Metric Labels as Metric Attributes in OTel, not as Resource Attributes [fix] Correctly add Metric Labels as Metric Attributes in OTel, not as Resource Attributes Sep 3, 2025
@dashpole
Copy link
Contributor

dashpole commented Sep 4, 2025

I will review by next Tuesday.

@github-actions
Copy link
Contributor

This PR was marked stale due to lack of activity. It will be closed in 14 days.

@github-actions github-actions bot added the Stale label Sep 21, 2025
@mdonkers
Copy link
Contributor Author

still waiting for approval... Not stale.

@github-actions github-actions bot removed the Stale label Sep 22, 2025
@dashpole dashpole added ready to merge Code review completed; ready to merge by maintainers and removed waiting-for-code-owners labels Sep 23, 2025
@mx-psi mx-psi merged commit ac33209 into open-telemetry:main Sep 23, 2025
186 checks passed
@otelbot
Copy link
Contributor

otelbot bot commented Sep 23, 2025

Thank you for your contribution @mdonkers! 🎉 We would like to hear from you about your experience contributing to OpenTelemetry by taking a few minutes to fill out this survey.

@github-actions github-actions bot added this to the next release milestone Sep 23, 2025
@mdonkers mdonkers deleted the fix-42232-align-metric-attributes branch September 23, 2025 15:35
@dashpole
Copy link
Contributor

Sorry for the delay @mdonkers

@mdonkers
Copy link
Contributor Author

@dashpole no worries! We had a work-around for this in our product as we saw customers sending data coming from this receiver (and thus seeing some unexpected attributes). We'll need to keep the work-around in place as customers will take time to upgrade.
But very happy to have it fixed here. Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready to merge Code review completed; ready to merge by maintainers receiver/googlecloudmonitoring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Metric Labels end up both as Resource Attributes and Metric Attributes

4 participants