-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Closed
Labels
bugSomething isn't workingSomething isn't workingreceiver/prometheusPrometheus receiverPrometheus receiver
Description
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.
opentelemetry-collector-contrib/receiver/prometheusreceiver/internal/metrics_adjuster.go
Lines 260 to 265 in 15ddc29
job, found := metrics.ResourceMetrics().At(0).Resource().Attributes().Get(semconv.AttributeServiceName) | |
if !found { | |
return errors.New("adjusting metrics without job") | |
} | |
instance, found := metrics.ResourceMetrics().At(0).Resource().Attributes().Get(semconv.AttributeServiceInstanceID) |
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
dashpole and wbollock
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingreceiver/prometheusPrometheus receiverPrometheus receiver