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

Open
ridwanmsharif opened this issue Nov 20, 2024 · 1 comment · May be fixed by #36479
Open
Labels
bug Something isn't working needs triage New item requiring triage receiver/prometheus Prometheus receiver

Comments

@ridwanmsharif
Copy link
Contributor

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.

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

@ridwanmsharif ridwanmsharif added bug Something isn't working needs triage New item requiring triage labels Nov 20, 2024
@github-actions github-actions bot added the receiver/prometheus Prometheus receiver label Nov 20, 2024
Copy link
Contributor

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage New item requiring triage receiver/prometheus Prometheus receiver
Projects
None yet
1 participant