You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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 isprometheus_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.The text was updated successfully, but these errors were encountered: