# ref: https://github.com/grafana/helm-charts/tree/main/charts

loki:
  enabled: true
  persistence:
    enabled: true
    accessModes:
    - ReadWriteOnce
    size: 2Gi
    annotations: {}
    # selector:
    #   matchLabels:
    #     app.kubernetes.io/name: loki
    # subPath: ""
    # existingClaim:

promtail:
  enabled: true

fluent-bit:
  enabled: false

grafana:
  enabled: true
  persistence:
    type: pvc
    enabled: true
    accessModes:
      - ReadWriteOnce
    size: 5Gi
  sidecar:
    datasources:
      enabled: true
  image:
    tag: 8.3.5
  namespaceOverride: ""
  # For mapping a path to ambassador
  grafana.ini:
    server:
      root_url: http://localhost:3000/grafana/
      serve_from_sub_path: true
    paths:
      data: /var/lib/grafana/data
      logs: /var/log/grafana
      plugins: /var/lib/grafana/plugins
      provisioning: /etc/grafana/provisioning
    analytics:
      check_for_updates: true
    log:
      mode: console

prometheus:
#ref: https://github.com/prometheus-community/helm-charts/blob/main/charts/prometheus/values.yaml
  enabled: true
  persistentVolume:
    enabled: true
    accessModes:
      - ReadWriteOnce
    annotations: {}
    existingClaim: ""
    mountPath: /data
    size: 5Gi


filebeat:
  enabled: false
  filebeatConfig:
    filebeat.yml: |
      # logging.level: debug
      filebeat.inputs:
      - type: container
        paths:
          - /var/log/containers/*.log
        processors:
        - add_kubernetes_metadata:
            host: ${NODE_NAME}
            matchers:
            - logs_path:
                logs_path: "/var/log/containers/"
      output.logstash:
        hosts: ["logstash-loki:5044"]

logstash:
  enabled: false
  image: grafana/logstash-output-loki
  imageTag: 1.0.1
  filters:
    main: |-
      filter {
        if [kubernetes] {
          mutate {
            add_field => {
              "container_name" => "%{[kubernetes][container][name]}"
              "namespace" => "%{[kubernetes][namespace]}"
              "pod" => "%{[kubernetes][pod][name]}"
            }
            replace => { "host" => "%{[kubernetes][node][name]}"}
          }
        }
        mutate {
          remove_field => ["tags"]
        }
      }
  outputs:
    main: |-
      output {
        loki {
          url => "http://loki:3100/loki/api/v1/push"
          #username => "test"
          #password => "test"
        }
        # stdout { codec => rubydebug }
      }
