receivers:
  prometheus:
    config:
      scrape_configs:
      - job_name: apps
        kubernetes_sd_configs:
        - role: pod
          selectors:
          - role: pod
            # only scrape data from pods running on the same node as collector
            field: "spec.nodeName=$NODE_NAME"
        relabel_configs:
        # scrape pods annotated with "prometheus.io/scrape: true"
        - source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_scrape]
          regex: "true"
          action: keep
        # read the port from "prometheus.io/port: <port>" annotation and update scraping address accordingly
        - source_labels: [__address__, __meta_kubernetes_pod_annotation_prometheus_io_port]
          action: replace
          target_label: __address__
          regex: ([^:]+)(?::\d+)?;(\d+)
          # escaped $1:$2
          replacement: $$1:$$2
        - source_labels: [__meta_kubernetes_namespace]
          action: replace
          target_label: kubernetes_namespace
        - source_labels: [__meta_kubernetes_pod_name]
          action: replace
          target_label: kubernetes_pod_name

processors:
  exampleprocessor:

exporters:
  exampleexporter:

service:
  pipelines:
    traces:
      receivers: [prometheus]
      processors: [exampleprocessor]
      exporters: [exampleexporter]
