---
# Source: sumologic/templates/traces/otelcol/configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: RELEASE-NAME-sumologic-otelcol
  labels:
    app: RELEASE-NAME-sumologic-fluentd-metrics
    chart: "sumologic-%CURRENT_CHART_VERSION%"
    release: "RELEASE-NAME"
    heritage: "Helm"
data:
  traces.otelcol.conf.yaml: |
    exporters:
      otlphttp:
        compression: gzip
        traces_endpoint: ${SUMO_ENDPOINT_DEFAULT_TRACES_SOURCE}
      sumologic:
        compress_encoding: gzip
        endpoint: ${SUMO_ENDPOINT_DEFAULT_METRICS_SOURCE}
        log_format: text
        max_request_body_size: 1048576
        metadata_attributes:
        - k8s.*
        - host.name
        metric_format: prometheus
        retry_on_failure:
          enabled: true
          initial_interval: 5s
          max_elapsed_time: 120s
          max_interval: 30s
        sending_queue:
          enabled: false
          num_consumers: 10
          queue_size: 5000
        source_category: "%{namespace}/%{pod_name}"
        source_host: '%{host.name}'
        source_name: "%{namespace}.%{pod}.%{container}"
        timeout: 5s
      zipkin:
        endpoint: ${SUMO_ENDPOINT_DEFAULT_TRACES_SOURCE}
    extensions:
      health_check: {}
      memory_ballast:
        size_mib: 683
    processors:
      batch:
        send_batch_max_size: 512
        send_batch_size: 256
        timeout: 5s
      cascading_filter:
        num_traces: 200000
      k8s_tagger:
        extract:
          annotations:
          - key: '*'
            tag_name: k8s.pod.annotation.%s
          labels:
          - key: '*'
            tag_name: k8s.pod.label.%s
          metadata:
          - containerId
          - containerName
          - clusterName
          - daemonSetName
          - deploymentName
          - hostName
          - namespace
          - nodeName
          - podId
          - podName
          - replicaSetName
          - serviceName
          - statefulSetName
          namespace_labels:
          - key: '*'
            tag_name: k8s.namespace.label.%s
        owner_lookup_enabled: true
        passthrough: false
      memory_limiter:
        check_interval: 5s
        limit_mib: 1900
      resource:
        attributes:
        - action: upsert
          key: k8s.cluster.name
          value: kubernetes
      resourcedetection:
        detectors:
        - system
        override: false
        timeout: 10s
      source:
        annotation_prefix: k8s.pod.annotation.
        collector: "kubernetes"
        container_key: k8s.container.name
        exclude_container_regex: "[123+]bar$|xyz"
        exclude_host_regex: "hhh123"
        exclude_namespace_regex: "kube\\s+"
        exclude_pod_regex: "^foo.*"
        namespace_key: k8s.namespace.name
        pod_key: k8s.pod.name
        pod_name_key: k8s.pod.pod_name
        pod_template_hash_key: k8s.pod.label.pod-template-hash
        source_category: "%{namespace}/%{pod_name}"
        source_category_prefix: "kubernetes/"
        source_category_replace_dash: "/"
        source_host_key: k8s.pod.hostname
        source_name: "%{namespace}.%{pod}.%{container}"
    receivers:
      jaeger:
        protocols:
          grpc:
            endpoint: 0.0.0.0:14250
          thrift_binary:
            endpoint: 0.0.0.0:6832
          thrift_compact:
            endpoint: 0.0.0.0:6831
          thrift_http:
            endpoint: 0.0.0.0:14268
      opencensus:
        endpoint: 0.0.0.0:55678
      otlp:
        protocols:
          grpc:
            endpoint: 0.0.0.0:4317
          http:
            endpoint: 0.0.0.0:4318
      zipkin:
        endpoint: 0.0.0.0:9411
    service:
      extensions:
      - health_check
      - memory_ballast
      pipelines:
        metrics:
          exporters:
          - sumologic
          processors:
          - memory_limiter
          - k8s_tagger
          - resourcedetection
          - resource
          - batch
          receivers:
          - otlp
        traces:
          exporters:
          - otlphttp
          processors:
          - memory_limiter
          - k8s_tagger
          - source
          - resource
          - cascading_filter
          - batch
          receivers:
          - jaeger
          - opencensus
          - otlp
          - zipkin
