grafana / loki

Like Prometheus, but for logs.
https://grafana.com/loki
GNU Affero General Public License v3.0
23.35k stars 3.38k forks source link

mixins: templatize cluster label name. #6352

Closed hervenicol closed 2 years ago

hervenicol commented 2 years ago

Is your feature request related to a problem? Please describe.

My Prometheus setup selects data from a specific cluster thanks to a cluster_id label. The Loki mixins use a hardcoded cluster label. I would like to be able to configure this when generating the dashboards.

Describe the solution you'd like mixins are meant to templatize dashboards creation, so I think we could have a 'per_cluster_label' in config.jsonnet file, to select the label name according to our setup. That would be quite similar to what is done on kubernetes-mixins here: https://github.com/kubernetes-monitoring/kubernetes-mixin#multi-cluster-support

Describe alternatives you've considered Apart from dirty forking, not much.

Additional context N/A

hervenicol commented 2 years ago

PR reverted here: https://github.com/grafana/loki/pull/6377 Will create a new (and hopefully better) PR. @kavirajk , can you please reopen the issue? :pray: