open-telemetry / opentelemetry-collector-contrib

Contrib repository for the OpenTelemetry Collector
https://opentelemetry.io
Apache License 2.0
3.1k stars 2.39k forks source link

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

Open ridwanmsharif opened 1 day ago

ridwanmsharif commented 1 day ago

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