Prometheus Operator Concepts: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 16: Line 16:


==ServiceMonitor Resource==
==ServiceMonitor Resource==
A ServiceMonitor is a custom resource
<font color=darkgray>The labels are important, they must match [[#Prometheus_Resource|Prometheus]] serviceMonitorSelector.</font>
<font color=darkgray>The labels are important, they must match [[#Prometheus_Resource|Prometheus]] serviceMonitorSelector.</font>



Revision as of 22:15, 14 October 2020

Internal

Custom Resources

Prometheus Resource

The Prometheus resource declares a "serviceMonitorSelector":

apiVersion: monitoring.coreos.com/v1
kind: Prometheus
...
spec:
  serviceMonitorSelector:
    matchLabels:
      release: prometheus

ServiceMonitor Resource

A ServiceMonitor is a custom resource


The labels are important, they must match Prometheus serviceMonitorSelector.

The current service monitor list can be obtained with:

kubectl -n <namespace> get servicemonitors

Configuring Prometheus with Prometheus Operator

Configuring Prometheus with Prometheus Operator