8000 promlint: Refine lintMetricTypeInName · Issue #1453 · prometheus/client_golang · GitHub
[go: up one dir, main page]

Skip to content

promlint: Refine lintMetricTypeInName  #1453

@beorn7

Description

@beorn7

lintMetricTypeInName is very prone to false positives: The various metric types could all be used as normal words in metrics, where they aren't used at all to mark the metric type. A practical example raised in prometheus/prometheus#13660 is prometheus_target_scrapes_exceeded_native_histogram_bucket_limit_total. It counts how often the bucket limit was exceeded when scraping a native histogram. This metric isn't even a histogram, but promlint complains that the metric type is used as part of the metric name.

Which brings me to my proposal here: lintMetricTypeInName could simply only complain if the word used in the metric name coincides with the actual type of the metric. This will still allow false positives (medication_sold_over_the_counter_total as a contrived example for a counter), but it will at least exclude some of the false positives, and notably those that are false positives for sure.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0