Skip to content

fix(collector): skip samples with invalid metric names instead of panicking - #363

Open
AruneshDwivedi wants to merge 1 commit into
prometheus:masterfrom
AruneshDwivedi:fix/skip-invalid-metric-names
Open

AruneshDwivedi wants to merge 1 commit into
prometheus:masterfrom
AruneshDwivedi:fix/skip-invalid-metric-names

Conversation

@AruneshDwivedi

Copy link
Copy Markdown

prometheus.MustNewConstMetric panics when given an invalid metric name (e.g., one starting with a number or containing invalid characters). The graphite_exporter stores samples in a map and iterates them in the Collect method without validating the final metric name.\n\nFix: use prometheus.NewDesc and prometheus.NewConstMetric directly, check for nil/error, and increment droppedSamples counter instead of panicking.\n\nFixes #355.

…icking

Signed-off-by: Arunesh Dwivedi <arunesh.devops@gmail.com>
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

Successfully merging this pull request may close these issues.

1 participant