istio.io/istio@v0.0.0-20240520182934-d79c90f27776/samples/addons/extras/prometheus-operator.yaml (about)

     1  apiVersion: monitoring.coreos.com/v1
     2  kind: PodMonitor
     3  metadata:
     4    name: envoy-stats-monitor
     5    namespace: istio-system
     6    labels:
     7      monitoring: istio-proxies
     8      release: istio
     9  spec:
    10    selector:
    11      matchExpressions:
    12      - {key: istio-prometheus-ignore, operator: DoesNotExist}
    13    namespaceSelector:
    14      any: true
    15    jobLabel: envoy-stats
    16    podMetricsEndpoints:
    17    - path: /stats/prometheus
    18      interval: 15s
    19      relabelings:
    20      - action: keep
    21        sourceLabels: [__meta_kubernetes_pod_container_name]
    22        regex: "istio-proxy"
    23      - action: keep
    24        sourceLabels: [__meta_kubernetes_pod_annotationpresent_prometheus_io_scrape]
    25      - action: replace
    26        regex: (\d+);(([A-Fa-f0-9]{1,4}::?){1,7}[A-Fa-f0-9]{1,4})
    27        replacement: '[$2]:$1'
    28        sourceLabels:
    29        - __meta_kubernetes_pod_annotation_prometheus_io_port
    30        - __meta_kubernetes_pod_ip
    31        targetLabel: __address__
    32      - action: replace
    33        regex: (\d+);((([0-9]+?)(\.|$)){4})
    34        replacement: $2:$1
    35        sourceLabels:
    36        - __meta_kubernetes_pod_annotation_prometheus_io_port
    37        - __meta_kubernetes_pod_ip
    38        targetLabel: __address__
    39      - action: labeldrop
    40        regex: "__meta_kubernetes_pod_label_(.+)"
    41      - sourceLabels: [__meta_kubernetes_namespace]
    42        action: replace
    43        targetLabel: namespace
    44      - sourceLabels: [__meta_kubernetes_pod_name]
    45        action: replace
    46        targetLabel: pod_name
    47  ---
    48  apiVersion: monitoring.coreos.com/v1
    49  kind: ServiceMonitor
    50  metadata:
    51    name: istio-component-monitor
    52    namespace: istio-system
    53    labels:
    54      monitoring: istio-components
    55      release: istio
    56  spec:
    57    jobLabel: istio
    58    targetLabels: [app]
    59    selector:
    60      matchExpressions:
    61      - {key: istio, operator: In, values: [pilot]}
    62    namespaceSelector:
    63      any: true
    64    endpoints:
    65    - port: http-monitoring
    66      interval: 15s