diff --git a/monitoring/monitors/logging/serviceMonitor-elasticsearch-v2.yaml b/monitoring/monitors/logging/serviceMonitor-elasticsearch-v2.yaml new file mode 100644 index 00000000..e3a6d956 --- /dev/null +++ b/monitoring/monitors/logging/serviceMonitor-elasticsearch-v2.yaml @@ -0,0 +1,23 @@ +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: elasticsearch-v2 + labels: + sas.com/monitoring-base: kube-viya-monitoring +spec: + selector: + matchLabels: + app.kubernetes.io/name: prometheus-elasticsearch-exporter + namespaceSelector: + any: true + # Optional: change 'any' to 'false' above to limit namespace(s) + # matchNames: + # - logging + endpoints: + - port: http + path: /metrics + metricRelabelings: + # The Elasticsearch exporters inexplicably uses a 'node' label, which + # conflicts with the common Kubernetes 'node' label, so rename it + - sourceLabels: [node] + targetLabel: es_node