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

receiver/prometheus: remove assumption that scraped metrics share a resource #36479

Conversation

ridwanmsharif
Copy link
Contributor

@ridwanmsharif ridwanmsharif commented Nov 20, 2024

Description

This change removes as assumption that all metrics in a single scrape come from the same resource. This is indeed not true when honor_labels is set to true AND when the scraped metrics contain a job or instance label.

Link to tracking issue

Fixes #36477

Testing

Added unit tests

Documentation

N/A

@github-actions github-actions bot added the receiver/prometheus Prometheus receiver label Nov 20, 2024
@ridwanmsharif ridwanmsharif force-pushed the ridwanmsharif/adjuster-resource-fix branch from 4a675f9 to b4af9c7 Compare November 21, 2024 21:37
@ridwanmsharif ridwanmsharif marked this pull request as ready for review November 21, 2024 21:38
@ridwanmsharif ridwanmsharif requested a review from a team as a code owner November 21, 2024 21:38
Copy link
Contributor

github-actions bot commented Dec 8, 2024

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 Dec 8, 2024
@dashpole dashpole removed the Stale label Dec 9, 2024
@ridwanmsharif ridwanmsharif force-pushed the ridwanmsharif/adjuster-resource-fix branch 2 times, most recently from bb2a3b4 to 7d556ee Compare December 11, 2024 19:04
…esource

This change removes as assumption that all metrics in a single scrape come from
the same resource. This is indeed not true when `honor_labels` is set to `true`
AND when the scraped metrics contain a `job` or `instance` label.
@ridwanmsharif ridwanmsharif force-pushed the ridwanmsharif/adjuster-resource-fix branch from 7d556ee to 360b8e1 Compare December 11, 2024 19:53
@dashpole
Copy link
Contributor

prometheusreceiver/internal/metrics_adjuster_test.go:136: File is not gofumpt-ed (gofumpt)

@ridwanmsharif ridwanmsharif force-pushed the ridwanmsharif/adjuster-resource-fix branch from 360b8e1 to 834bb25 Compare December 12, 2024 15:36
@dashpole dashpole added the ready to merge Code review completed; ready to merge by maintainers label Dec 12, 2024
@andrzej-stencel andrzej-stencel merged commit c4d8b9d into open-telemetry:main Dec 16, 2024
170 checks passed
@github-actions github-actions bot added this to the next release milestone Dec 16, 2024
sbylica-splunk pushed a commit to sbylica-splunk/opentelemetry-collector-contrib that referenced this pull request Dec 17, 2024
…esource (open-telemetry#36479)

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
This change removes as assumption that all metrics in a single scrape
come from the same resource. This is indeed not true when `honor_labels`
is set to `true` AND when the scraped metrics contain a `job` or
`instance` label.

<!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable. -->
#### Link to tracking issue
Fixes open-telemetry#36477

<!--Describe what testing was performed and which tests were added.-->
#### Testing
Added unit tests

<!--Describe the documentation added.-->
#### Documentation
N/A

<!--Please delete paragraphs that you did not use before submitting.-->
mterhar pushed a commit to mterhar/opentelemetry-collector-contrib that referenced this pull request Dec 19, 2024
…esource (open-telemetry#36479)

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
This change removes as assumption that all metrics in a single scrape
come from the same resource. This is indeed not true when `honor_labels`
is set to `true` AND when the scraped metrics contain a `job` or
`instance` label.

<!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable. -->
#### Link to tracking issue
Fixes open-telemetry#36477

<!--Describe what testing was performed and which tests were added.-->
#### Testing
Added unit tests

<!--Describe the documentation added.-->
#### Documentation
N/A

<!--Please delete paragraphs that you did not use before submitting.-->
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/prometheus Prometheus receiver
Projects
None yet
Development

Successfully merging this pull request may close these issues.

receiver/prometheus: Metric adjuster sets start time incorrectly when honor_labels==true
6 participants