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

Explicit Exception for Duplicate Labels during Scrape #942

Closed
fstab opened this issue Apr 5, 2024 · 1 comment
Closed

Explicit Exception for Duplicate Labels during Scrape #942

fstab opened this issue Apr 5, 2024 · 1 comment

Comments

@fstab
Copy link
Member

fstab commented Apr 5, 2024

When a collector produces duplicate labels (same metric name, same label names, same label values) during scrape, client_java throws an IllegalArgumentException.

throw new IllegalArgumentException("Duplicate labels in metric data: " + dataPoints.get(i).getLabels());

It would be better to have an explicit Exception for that so the collector can catch it. This would help with prometheus/jmx_exporter#911 (comment)

@dhoard dhoard changed the title Explicit Exception for Duplicat Labels during Scrape Explicit Exception for Duplicate Labels during Scrape Apr 5, 2024
@dhoard
Copy link
Collaborator

dhoard commented Apr 5, 2024

Looking at the code, MetricSnapshot has the MetricMetadata which could be added to the exception. This would provide more information about the configuration issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants