Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supports external labels for prometheus queries #5361

Open
killme2008 opened this issue Jan 15, 2025 · 0 comments
Open

Supports external labels for prometheus queries #5361

killme2008 opened this issue Jan 15, 2025 · 0 comments
Labels
C-enhancement Category Enhancements

Comments

@killme2008
Copy link
Contributor

What type of enhancement is this?

API improvement

What does the enhancement do?

Prometheus supports external labels:

# The labels to add to any time series or alerts when communicating with
  # external systems (federation, remote storage, Alertmanager). 
  # Environment variable references `${var}` or `$var` are replaced according 
  # to the values of the current environment variables. 
  # References to undefined variables are replaced by the empty string.
  # The `$` character can be escaped by using `$$`.
  external_labels:
    [ [<labelname>](https://prometheus.io/docs/prometheus/latest/configuration/configuration/#labelname): [<labelvalue>](https://prometheus.io/docs/prometheus/latest/configuration/configuration/#labelvalue) ... ]

For example, when you collect metrics from k8s cluster, the kube_node_infohas a column cluster which is a external label from prometheus.

And some Grafana dashboards need such labels for rendering.

image

So maybe we can choose to support the external labels as configuration per db:

[db.prometheus]
external_labels:
   cluster: test_cluster

Implementation challenges

No response

@killme2008 killme2008 added the C-enhancement Category Enhancements label Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category Enhancements
Projects
None yet
Development

No branches or pull requests

1 participant