This is 1m read article written by Kuberneteslab. In this article we will discuss about the keep action for keeping certain metrics in Prometheus and dropping everything else.
Prometheus provides rich features like dropping the metrics and keeping the metrics which can specified under job configuration.
To keep the specific metric:
__name__ indicates the metric name by default. With the config above for job-1 it will scrape only metrics which are matching regex provided in configuration.
Metric relabeling is applied to samples as the last step before ingestion. Make sure the configuration uses “metric_relabel_configs”.