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
Copy file name to clipboardExpand all lines: README.md
+41-2Lines changed: 41 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,12 @@ Metrics Usage
6
6
7
7
This tool analyzes static files - like dashboards and Prometheus alert rules - to track where and how Prometheus metrics are used.
8
8
9
-
It’s especially helpful for identifying whether metrics are actively used. Unused metrics should ideally not be scraped by Prometheus to avoid unnecessary load.
9
+
It’s especially helpful for identifying whether metrics are actively used.
10
+
Prometheus should ideally not scrape unused metrics to avoid an unnecessary load.
11
+
12
+
## API exposed
13
+
14
+
### Metrics
10
15
11
16
The tool provides an API endpoint, `/api/v1/metrics`, which returns the usage data for each collected metric as shown below:
12
17
@@ -77,7 +82,41 @@ You can used the following query parameter to filter the list returned:
77
82
***metric_name**: when used, it will trigger a fuzzy search on the metric_name based on the pattern provided.
78
83
***used**: when used, will return only the metric used or not (depending if you set this boolean to true or to false). Leave it empty if you want both.
79
84
80
-
## How to use it
85
+
### Invalid Metrics
86
+
87
+
The API endpoint `/api/v1/invalid_metrics` is exposing the usage for metrics that contains variable or regexp.
The API endpoint `/api/v1/pending_usages` is exposing usage associated to metrics that has not yet been associated to the metrics available on the endpoint `/api/v1/metrics`.
116
+
117
+
It's even possible usage is never associated as the metric doesn't exist anymore.
0 commit comments