{{- if .Values.enabled | default false }}
apiVersion: v1
kind: ConfigMap
metadata:
  name: fluent-bit-configmap
data:
  LOKI_URL: {{ quote .Values.env.lokiUrl }}
  fluent-bit.conf: |
    [INPUT]
        Name        forward
        Listen      0.0.0.0
        Port        24224
    [Output]
        Name grafana-loki
        Match *
        Url ${LOKI_URL}
        RemoveKeys source
        Labels {job="fluent-bit"}
        LabelKeys container_name, traceID
        BatchWait 1s
        BatchSize 1001024
        LineFormat json
        LogLevel info
{{- end }}