How can I add a static labels to `kubernetes_sd_configs`?

I am using the recommended Promtail Kubernetes installation with this configuration:

I tried to add static labels like this, but it seems that it is not valid for kubernetes_sd_configs and it produces error:

    labels:
      log_app_source: k8

How can I add a static labels to kubernetes_sd_configs ?

I believe you are looking for static_labels, see static_labels | Grafana Loki documentation.

Thank you for help.

Do you know any working sample that incorporates kubernetes_sd_configs with static_labels by any chance?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.