apiVersion: v1
kind: ConfigMap
metadata:
  name: otel-collector
  labels:
    app: opentelemetry
    component: otel-collector
data:
  otel-collector-config: |
    extensions:
        health_check:

    receivers:
        redis:
          endpoint: "${REDIS_ADDR}"
          service_name: "cartservice"
          collection_interval: 10s
        k8s_cluster:
          auth_type: serviceAccount
          node_conditions_to_report: [Ready, MemoryPressure]
        otlp:
          protocols:
              grpc:
      
    exporters:
        logging:
            loglevel: debug

        # configuring otlp to public satellites
        otlp:
          endpoint: "${LIGHTSTEP_HOST}:${LIGHTSTEP_PORT}"
          headers: 
            "lightstep-access-token": "${LS_ACCESS_TOKEN}"

    processors:
        batch:
      
    service:
        extensions: [health_check]
        pipelines:
          traces:
            receivers: [otlp]
            exporters: [logging, otlp]
            processors: [batch]
          metrics:
            receivers: [otlp, redis, k8s_cluster]
            exporters: [logging, otlp]