apiVersion: v1
data:
  otel-collector-config.yml: |-
    receivers:
      jaeger:
        protocols:
          grpc:
            endpoint: "0.0.0.0:14250"
          thrift_http:
            endpoint: "0.0.0.0:14278"

      # Dummy receiver that's never used, because a pipeline is required to have one.
      otlp/spanmetrics:
        protocols:
          grpc:
            endpoint: "localhost:65535"

    exporters:
      prometheus:
        endpoint: "0.0.0.0:8889"

      jaeger:
        endpoint: "0.0.0.0:14250"
        tls:
          insecure: true

    processors:
      #  tail_sampling:
      #    decision_wait: 10s
      #    num_traces: 100
      #    expected_new_traces_per_sec: 10
      #    policies:
      #      [
      #        {
      #          name: latency-policy,
      #          type: latency,
      #          latency: { threshold_ms: 5000 }
      #        },
      #        {
      #          name: status-code-policy,
      #          type: status_code,
      #          status_code: { status_codes: [ ERROR, OK ] }
      #        },
      #        {
      #          name: string-policy,
      #          type: string_attribute,
      #          string_attribute: { key: alarm, values: [ unexpected ] }
      #        }
      #      ]
      batch:
      spanmetrics:
        metrics_exporter: prometheus

    service:
      pipelines:
        traces:
          receivers: [jaeger]
          processors: [spanmetrics, batch]
          #      processors: [spanmetrics, tail_sampling]
          exporters: [jaeger]
        # The exporter name in this pipeline must match the spanmetrics.metrics_exporter name.
        # The receiver is just a dummy and never used; added to pass validation requiring at least one receiver in a pipeline.
        metrics/spanmetrics:
          receivers: [otlp/spanmetrics]
          exporters: [prometheus]
kind: ConfigMap
metadata:
  name: otel-conf