mirror of https://git.rancher.io/charts
45 lines
1.4 KiB
YAML
45 lines
1.4 KiB
YAML
|
{{- if and .Values.serviceMonitor .Values.clients }}{{- if and .Values.serviceMonitor.enabled .Values.clients.enabled }}
|
||
|
apiVersion: monitoring.coreos.com/v1
|
||
|
kind: ServiceMonitor
|
||
|
metadata:
|
||
|
labels: {{ include "windowsExporter.labels" . | nindent 4 }}
|
||
|
name: {{ template "windowsExporter.name" . }}
|
||
|
namespace: {{ template "windowsExporter.namespace" . }}
|
||
|
spec:
|
||
|
selector:
|
||
|
matchLabels: {{ include "windowsExporter.labels" . | nindent 6 }}
|
||
|
namespaceSelector:
|
||
|
matchNames:
|
||
|
- {{ template "windowsExporter.namespace" . }}
|
||
|
jobLabel: component
|
||
|
podTargetLabels:
|
||
|
- component
|
||
|
endpoints:
|
||
|
- port: windows-metrics
|
||
|
metricRelabelings:
|
||
|
- sourceLabels: [__name__]
|
||
|
regex: 'wmi_(.*)'
|
||
|
replacement: 'windows_$1'
|
||
|
targetLabel: __name__
|
||
|
- sourceLabels: [__name__]
|
||
|
regex: windows_mssql_transactions_active_total
|
||
|
replacement: 'windows_mssql_transactions_active'
|
||
|
targetLabel: __name__
|
||
|
- sourceLabels: [volume, nic]
|
||
|
regex: (.*);(.*)
|
||
|
separator: ''
|
||
|
targetLabel: device
|
||
|
action: replace
|
||
|
replacement: $1$2
|
||
|
- sourceLabels: [__name__]
|
||
|
regex: windows_cs_logical_processors
|
||
|
replacement: 'system'
|
||
|
targetLabel: mode
|
||
|
relabelings:
|
||
|
- separator: ':'
|
||
|
sourceLabels:
|
||
|
- __meta_kubernetes_pod_host_ip
|
||
|
- __meta_kubernetes_pod_container_port_number
|
||
|
targetLabel: instance
|
||
|
{{- end }}{{- end }}
|