---
# Source: splunk-otel-collector/templates/configmap-otel-agent.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: default-splunk-otel-collector-otel-agent
  labels:
    app: splunk-otel-collector
    chart: splunk-otel-collector-0.28.0
    release: default
    heritage: Helm
data:
  relay: |
    exporters:
      sapm:
        access_token: ${SPLUNK_ACCESS_TOKEN}
        endpoint: https://ingest.CHANGEME.signalfx.com/v2/trace
      signalfx:
        access_token: ${SPLUNK_ACCESS_TOKEN}
        api_url: https://api.CHANGEME.signalfx.com
        correlation: null
        ingest_url: https://ingest.CHANGEME.signalfx.com
        sync_host_metadata: true
      splunk_hec:
        endpoint: https://ingest.CHANGEME.signalfx.com/v1/log
        token: ${SPLUNK_ACCESS_TOKEN}
    extensions:
      health_check: null
      k8s_observer:
        auth_type: serviceAccount
        node: ${K8S_NODE_NAME}
      zpages: null
    processors:
      batch: null
      k8s_tagger:
        extract:
          metadata:
          - namespace
          - node
          - podName
          - podUID
        filter:
          node_from_env_var: K8S_NODE_NAME
      memory_limiter:
        ballast_size_mib: ${SPLUNK_BALLAST_SIZE_MIB}
        check_interval: 5s
        limit_mib: ${SPLUNK_MEMORY_LIMIT_MIB}
      resource:
        attributes:
        - action: insert
          key: k8s.node.name
          value: ${K8S_NODE_NAME}
        - action: insert
          key: k8s.cluster.name
          value: CHANGEME
      resource/add_agent_k8s:
        attributes:
        - action: insert
          key: k8s.pod.name
          value: ${K8S_POD_NAME}
        - action: insert
          key: k8s.pod.uid
          value: ${K8S_POD_UID}
        - action: insert
          key: k8s.namespace.name
          value: ${K8S_NAMESPACE}
      resourcedetection:
        detectors:
        - system
        - env
        override: false
        timeout: 10s
    receivers:
      fluentforward:
        endpoint: 0.0.0.0:8006
      hostmetrics:
        collection_interval: 10s
        scrapers:
          cpu: null
          disk: null
          filesystem: null
          load: null
          memory: null
          network: null
          paging: null
          processes: null
      jaeger:
        protocols:
          grpc:
            endpoint: 0.0.0.0:14250
          thrift_http:
            endpoint: 0.0.0.0:14268
      kubeletstats:
        auth_type: serviceAccount
        collection_interval: 10s
        endpoint: ${K8S_NODE_IP}:10250
        extra_metadata_labels:
        - container.id
        metric_groups:
        - container
        - pod
        - node
      otlp:
        protocols:
          grpc:
            endpoint: 0.0.0.0:4317
          http:
            endpoint: 0.0.0.0:55681
      prometheus/agent:
        config:
          scrape_configs:
          - job_name: otel-agent
            scrape_interval: 10s
            static_configs:
            - targets:
              - ${K8S_POD_IP}:8888
      receiver_creator:
        receivers: null
        watch_observers:
        - k8s_observer
      sapm:
        endpoint: 0.0.0.0:7276
      signalfx:
        endpoint: 0.0.0.0:9943
      smartagent/signalfx-forwarder:
        listenAddress: 0.0.0.0:9080
        type: signalfx-forwarder
      zipkin:
        endpoint: 0.0.0.0:9411
    service:
      extensions:
      - health_check
      - k8s_observer
      - zpages
      pipelines:
        logs:
          exporters:
          - splunk_hec
          processors:
          - memory_limiter
          - batch
          - resource
          - resourcedetection
          receivers:
          - fluentforward
        metrics:
          exporters:
          - signalfx
          processors:
          - memory_limiter
          - batch
          - resource
          - resourcedetection
          receivers:
          - hostmetrics
          - kubeletstats
          - receiver_creator
          - signalfx
        metrics/agent:
          exporters:
          - signalfx
          processors:
          - memory_limiter
          - batch
          - resource
          - resource/add_agent_k8s
          - resourcedetection
          receivers:
          - prometheus/agent
        traces:
          exporters:
          - sapm
          - signalfx
          processors:
          - memory_limiter
          - k8s_tagger
          - batch
          - resource
          - resourcedetection
          receivers:
          - otlp
          - jaeger
          - smartagent/signalfx-forwarder
          - zipkin
