grafana / helm-charts

Apache License 2.0
1.66k stars 2.27k forks source link

Promtail `limits_config` values not working #3294

Open ns0092 opened 2 months ago

ns0092 commented 2 months ago

Helm chart values with extraLimitsConfig error out on apply.

tolerations:
  - key: workload
    operator: Equal
    value: monitoring
    effect: NoSchedule
config:
  clients:
    - url: http://loki-loki-distributed-gateway/loki/api/v1/push
  snippets:
    extraLimitsConfig:
      readline_rate_enabled: true
      readline_rate: 1000
      readline_burst: 2000
    pipelineStages:
    - docker: {}
    - cri: {}
    common:
      - action: replace
        source_labels:
          - __meta_kubernetes_pod_node_name
        target_label: node_name
      - action: replace
        source_labels:
          - __meta_kubernetes_namespace
        target_label: namespace
      - action: replace
        replacement: $1
        separator: /
        source_labels:
          - namespace
          - app
        target_label: job
      - action: replace
        source_labels:
          - __meta_kubernetes_pod_name
        target_label: pod
      - action: replace
        source_labels:
          - __meta_kubernetes_pod_host_ip
        target_label: host
      - action: replace
        source_labels:
          - __meta_kubernetes_pod_label_release
        target_label: release
      - action: replace
        source_labels:
          - __meta_kubernetes_pod_phase
        target_label: pod_phase
      - action: replace
        source_labels:
          - __meta_kubernetes_pod_container_name
        target_label: container
      - action: replace
        replacement: /var/log/pods/*$1/*.log
        separator: /
        source_labels:
          - __meta_kubernetes_pod_uid
          - __meta_kubernetes_pod_container_name
        target_label: __path__
      - action: replace
        replacement: /var/log/pods/*$1/*.log
        regex: true/(.*)
        separator: /
        source_labels:
          - __meta_kubernetes_pod_annotationpresent_kubernetes_io_config_hash
          - __meta_kubernetes_pod_annotation_kubernetes_io_config_hash
          - __meta_kubernetes_pod_container_name
        target_label: __path__

It seems like extraLimitsConfig is expecting a value of type String but I want to provide:

    extraLimitsConfig:
      readline_rate_enabled: true
      readline_rate: 1000
      readline_burst: 2000

Helm chart version: 6.16.5 App version: 3.0.0

Can someone suggest how I can get this working? Appreciate the help!

SirBrickAlot commented 1 month ago

Hi ns0092,

try setting the extraLimitsConfig as follows:

extraLimitsConfig: |
  readline_rate_enabled: true
  readline_rate: 1000
  readline_burst: 2000

This should work