Skip to content

Instantly share code, notes, and snippets.

@alicek106
Created April 12, 2020 13:59
Show Gist options
  • Save alicek106/a1f434e57b2228714afbacc164a85c45 to your computer and use it in GitHub Desktop.
Save alicek106/a1f434e57b2228714afbacc164a85c45 to your computer and use it in GitHub Desktop.
envoy-stats.yaml
# 현재 버그(?) 가 있어, 원래 relabel config를 그대로 옮기면 prometheus env에 target_label이 들어가지 않는 이상한 현상이 있다.
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: envoy-stats-monitor
namespace: default
labels:
app: monitoring
monitoring: istio-proxies
spec:
selector:
matchExpressions:
- {key: istio-prometheus-ignore, operator: DoesNotExist}
namespaceSelector:
any: true
jobLabel: envoy-stats
endpoints:
- path: /stats/prometheus
targetPort: 15090
interval: 15s
relabelings:
- sourceLabels: [__meta_kubernetes_pod_container_port_name]
action: keep
regex: '.*-envoy-prom'
- action: labelmap
regex: "__meta_kubernetes_pod_label_(.+)"
- sourceLabels: [__meta_kubernetes_namespace]
action: replace
targetLabel: namespace
- sourceLabels: [__meta_kubernetes_pod_name]
action: replace
targetLabel: pod_name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment