TL; DR: some prometheus exporters such as kube-state-metrics
do emit a LOT of metrics and that will make a difference in your next bill so here’s how to drop them.
x
21
21
1
apiVersion monitoring.googleapis.com/v1
2
kind PodMonitoring
3
metadata
4
name my-app-monitoring
5
spec
6
endpoints
7
interval 1m
8
metricRelabeling
9
# drop is the action!
10
action drop
11
# a regex to match all metrics to be dropped
12
regex unwanted_metric_prefix-.*
13
# to match against the name of the metric
14
sourceLabels
15
__name__
16
path /metrics
17
port8080
18
selector
19
matchLabels
20
app my-app
21