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: Metric adjuster sets start time incorrectly when honor_labels==true #36477

Open ridwanmsharif opened 1 day ago

ridwanmsharif commented 1 day ago

Component(s)

receiver/prometheus

What happened?

Description

When honor_labels is set to true - the metrics could override the job and instance labels. But the metrics adjuster assumes that all the metrics from a single scrape share the same job and instance which isn't true.

https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/15ddc2998deabb640f904d6ed812bf89f43ab957/receiver/prometheusreceiver/internal/metrics_adjuster.go#L260-L265

Acceptance Criteria: validate and test against this assumption. Or add assertion that all metrics must come from the same resource if that is intended.

Collector version

all versions of contrib

Environment information

Environment

OS: (e.g., "Ubuntu 20.04") Compiler(if manually compiled): (e.g., "go 14.2")

OpenTelemetry Collector configuration

No response

Log output

No response

Additional context

No response

github-actions[bot] commented 1 day ago

Pinging code owners: