Skip to content

Commit 065d647

Browse files
feat: Add ServiceMonitor for OpenSearch to the monitoring stack (#299)
1 parent e01260a commit 065d647

File tree

1 file changed

+51
-1
lines changed

1 file changed

+51
-1
lines changed

stacks/monitoring/prometheus-service-monitors.yaml

Lines changed: 51 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# [x] Kafka - exporter
1313
# [x] NiFi 1 - native
1414
# [x] NiFi 2 - native
15-
# [ ] OpenSearch - not officially part of the platform yet
15+
# [x] OpenSearch - native
1616
# [ ] Spark - native - partially done, see comment on it below
1717
# [x] Superset - exporter
1818
# [x] Trino - native
@@ -169,6 +169,56 @@ spec:
169169
- app.kubernetes.io/role-group
170170
- app.kubernetes.io/version
171171
---
172+
apiVersion: monitoring.coreos.com/v1
173+
kind: ServiceMonitor
174+
metadata:
175+
name: stackable-opensearch
176+
labels:
177+
stackable.tech/vendor: Stackable
178+
release: prometheus
179+
spec:
180+
namespaceSelector:
181+
any: true
182+
selector:
183+
matchLabels:
184+
stackable.tech/vendor: Stackable
185+
prometheus.io/scrape: "true"
186+
app.kubernetes.io/name: opensearch
187+
endpoints:
188+
- relabelings:
189+
- sourceLabels:
190+
- __meta_kubernetes_service_annotation_prometheus_io_scheme
191+
action: replace
192+
targetLabel: __scheme__
193+
regex: (https?)
194+
- sourceLabels:
195+
- __meta_kubernetes_service_annotation_prometheus_io_path
196+
action: replace
197+
targetLabel: __metrics_path__
198+
regex: (.+)
199+
# Use the FQDN instead of the IP address because the IP address
200+
# is not contained in the certificate.
201+
- sourceLabels:
202+
- __meta_kubernetes_pod_name
203+
- __meta_kubernetes_service_name
204+
- __meta_kubernetes_namespace
205+
- __meta_kubernetes_service_annotation_prometheus_io_port
206+
action: replace
207+
targetLabel: __address__
208+
regex: (.+);(.+);(.+);(\d+)
209+
replacement: $1.$2.$3.svc.cluster.local:$4
210+
tlsConfig:
211+
ca:
212+
secret:
213+
name: prometheus-tls-certificate
214+
key: ca.crt
215+
podTargetLabels:
216+
- app.kubernetes.io/name
217+
- app.kubernetes.io/instance
218+
- app.kubernetes.io/component
219+
- app.kubernetes.io/role-group
220+
- app.kubernetes.io/version
221+
---
172222
# NiFI 2 is a beast on it's own...
173223
# We need to use mTLS (otherwise we get a 401) and can not use the PodIP
174224
apiVersion: monitoring.coreos.com/v1

0 commit comments

Comments
 (0)