# Generated by `mz-monitoring-build gen-scrape-configs` from podmonitor-materialize-operator.yaml and
# labels.yaml in packages/prometheus-scrapers/. Edit those, not this file.
apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata:
  name: materialize-operator
  labels:
    app.kubernetes.io/part-of: materialize
    app.kubernetes.io/name: materialize-operator
spec:
  selector:
    matchLabels:
      app.kubernetes.io/name: materialize-operator
  podTargetLabels:
  - materialize.cloud/organization-name
  - materialize.cloud/organization-namespace
  - materialize.cloud/organization-id
  - cluster.environmentd.materialize.cloud/cluster-id
  - cluster.environmentd.materialize.cloud/replica-id
  podMetricsEndpoints:
  - port: metrics
    path: /metrics
    relabelings: []
    metricRelabelings:
    - sourceLabels:
      - cluster_id
      - instance_id
      separator: ;
      targetLabel: cluster_id
      regex: ;([su][0-9]+)
      replacement: $1
      action: replace
    - sourceLabels:
      - cluster_id
      - compute_instance
      separator: ;
      targetLabel: cluster_id
      regex: ;([su][0-9]+)
      replacement: $1
      action: replace
    - sourceLabels:
      - cluster_id
      - compute_cluster_id
      separator: ;
      targetLabel: cluster_id
      regex: ;([su][0-9]+)
      replacement: $1
      action: replace
    - sourceLabels:
      - cluster_id
      - cluster_environmentd_materialize_cloud_cluster_id
      separator: ;
      targetLabel: cluster_id
      regex: ;([su][0-9]+)
      replacement: $1
      action: replace
    - sourceLabels:
      - replica_id
      - compute_replica_id
      separator: ;
      targetLabel: replica_id
      regex: ;([su][0-9]+)
      replacement: $1
      action: replace
    - sourceLabels:
      - replica_id
      - cluster_environmentd_materialize_cloud_replica_id
      separator: ;
      targetLabel: replica_id
      regex: ;([su][0-9]+)
      replacement: $1
      action: replace
    - sourceLabels:
      - cluster_name
      - compute_cluster_name
      separator: ;
      targetLabel: cluster_name
      regex: ;(.+)
      replacement: $1
      action: replace
    - sourceLabels:
      - __name__
      - cluster_name
      - name
      separator: ;
      targetLabel: cluster_name
      regex: mz_cluster_info;;(.+)
      replacement: $1
      action: replace
    - sourceLabels:
      - __name__
      - cluster_size
      - size
      separator: ;
      targetLabel: cluster_size
      regex: mz_cluster_info;;(.+)
      replacement: $1
      action: replace
    - sourceLabels:
      - __name__
      - replica_name
      - name
      separator: ;
      targetLabel: replica_name
      regex: mz_replica_info;;(.+)
      replacement: $1
      action: replace
    - sourceLabels:
      - __name__
      - replica_size
      - size
      separator: ;
      targetLabel: replica_size
      regex: mz_replica_info;;(.+)
      replacement: $1
      action: replace
    - sourceLabels:
      - __name__
      - object_name
      - name
      separator: ;
      targetLabel: object_name
      regex: mz_object_info;;(.+)
      replacement: $1
      action: replace
    - sourceLabels:
      - __name__
      - object_type
      - type
      separator: ;
      targetLabel: object_type
      regex: mz_object_info;;(.+)
      replacement: $1
      action: replace
    - sourceLabels:
      - collection_id
      - global_id
      separator: ;
      targetLabel: collection_id
      regex: ;(.+)
      replacement: $1
      action: replace
    - sourceLabels:
      - shard_id
      - shard
      separator: ;
      targetLabel: shard_id
      regex: ;(.+)
      replacement: $1
      action: replace
