apiVersion: v1
data:
  prometheus.yml: |-
    global:
      scrape_interval:     5s
      evaluation_interval: 5s

    scrape_configs:
      - job_name: prometheus
        static_configs:
          - targets:
            - localhost:9090

        metric_relabel_configs:
        - source_labels: [__name__]
          regex: go_(.+)
          action: drop
        - source_labels: [__name__]
          regex: http_(.+)
          action: drop
        - source_labels: [__name__]
          regex: net_(.+)
          action: drop
        - source_labels: [__name__]
          regex: process_(.+)
          action: drop
        - source_labels: [__name__]
          regex: prometheus_(.+)
          action: drop
        - source_labels: [__name__]
          regex: tsdb_(.+)
          action: drop

      - job_name: integration-pods

        kubernetes_sd_configs:
        - role: pod
          namespaces:
            names:
              - syndesis

        relabel_configs:
        - source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_scrape]
          action: keep
          regex: true
        - source_labels: [__meta_kubernetes_pod_label_syndesis_io_type]
          action: keep
          regex: integration
        - source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_path]
          action: replace
          target_label: __metrics_path__
          regex: (.+)
        - source_labels: [__address__, __meta_kubernetes_pod_annotation_prometheus_io_port]
          action: replace
          regex: ([^:]+)(?::\d+)?;(\d+)
          replacement: $1:$2
          target_label: __address__
        - action: labelmap
          regex: __meta_kubernetes_pod_label_(.+)
        - action: labelmap
          regex: __meta_kubernetes_pod_annotation_(syndesis.+)
        - source_labels: [__meta_kubernetes_namespace]
          action: replace
          target_label: kubernetes_namespace
        - source_labels: [__meta_kubernetes_pod_name]
          action: replace
          target_label: kubernetes_pod_name
        metric_relabel_configs:
        - source_labels: [__name__]
          regex: jmx_(.+)
          action: drop
        - source_labels: [__name__]
          regex: jvm_(.+)
          action: drop
        - source_labels: [__name__]
          regex: process_(.+)
          action: drop
        - source_labels: [type, __name__]
          separator: ':'
          regex: context:(org_apache_camel_ExchangesTotal|org_apache_camel_ExchangesFailed|io_syndesis_camel_StartTimestamp|io_syndesis_camel_LastExchangeCompletedTimestamp|io_syndesis_camel_LastExchangeFailureTimestamp)
          action: keep
kind: ConfigMap
metadata:
  creationTimestamp: "2020-01-30T20:28:07Z"
  labels:
    app: syndesis
    owner: 05c92d60-439f-11ea-ab61-52fdfc072182
    syndesis.io/app: syndesis
    syndesis.io/component: syndesis-prometheus
    syndesis.io/type: infrastructure
  name: syndesis-prometheus-config
  namespace: syndesis
  ownerReferences:
  - apiVersion: syndesis.io/v1beta1
    blockOwnerDeletion: true
    controller: true
    kind: Syndesis
    name: app
    uid: 05c92d60-439f-11ea-ab61-52fdfc072182
  resourceVersion: "110002"
  selfLink: /api/v1/namespaces/syndesis/configmaps/syndesis-prometheus-config
  uid: 06af24de-439f-11ea-ab61-52fdfc072182
