---
# Source: kafka-lag-exporter/templates/030-ConfigMap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: oso-kafka-lag-exporter-configmap
  labels:
    app.kubernetes.io/name: kafka-lag-exporter
    helm.sh/chart: kafka-lag-exporter-0.6.7
    app.kubernetes.io/instance: oso
    app.kubernetes.io/managed-by: Helm
data:
  application.conf: |
    kafka-lag-exporter {
      port = 8000
      poll-interval = 30 seconds
      lookup-table-size = 60
      client-group-id = "kafkalagexporter"
      kafka-client-timeout = 10 seconds
      clusters = [
        {
          name = "sandbox"
          bootstrap-brokers = "kafka.sandbox.svc.cluster.local:9092"
          consumer-properties = {
            sasl.jaas.config = "org.apache.kafka.common.security.plain.PlainLoginModule required username=\"kafka\" password=\"kafka-secret\";"
            sasl.mechanism = "PLAIN"
            security.protocol = "SASL_PLAINTEXT"
          }
          admin-client-properties = {
            sasl.jaas.config = "org.apache.kafka.common.security.plain.PlainLoginModule required username=\"kafka\" password=\"kafka-secret\";"
            sasl.mechanism = "PLAIN"
            security.protocol = "SASL_PLAINTEXT"
          }
          labels = {
            location = "london"
            zone = "eu-west-1"
          }
        }
      ]
      watchers = {
        strimzi = "false"
      }
      metric-whitelist = [
        ".*"
      ]
    }

    akka {
      loggers = ["akka.event.slf4j.Slf4jLogger"]
      loglevel = "DEBUG"
      logging-filter = "akka.event.slf4j.Slf4jLoggingFilter"
    }
  logback.xml: |
    <configuration>
        <variable name="ROOT_LOG_LEVEL" value="INFO" />
        <variable name="KAFKA_LAG_EXPORTER_LOG_LEVEL" value="INFO" />
        <variable name="KAFKA_LAG_EXPORTER_KAFKA_LOG_LEVEL" value="INFO" />
        <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
            <encoder>
                <pattern>%date{ISO8601} %-5level %logger{36} %X{akkaSource} - %msg %ex%n</pattern>
            </encoder>
        </appender>
        <logger name="org.apache.kafka" level="${KAFKA_LAG_EXPORTER_KAFKA_LOG_LEVEL}"/>
        <logger name="com.lightbend.kafkalagexporter" level="${KAFKA_LAG_EXPORTER_LOG_LEVEL}"/>
        <root level="${ROOT_LOG_LEVEL}">
            <appender-ref ref="STDOUT" />
        </root>
    </configuration>
