grafana / grafonnet

Jsonnet library for generating Grafana dashboards.
https://grafana.github.io/grafonnet/
Apache License 2.0
322 stars 19 forks source link

queryTypes required fileds #107

Closed b0kky closed 10 months ago

b0kky commented 10 months ago

Hello! I use fn queryTypes.withLabelValues(label, metric), where requirement fields is label and metric. But as i i see in grafana documentation , filed metric is optional, and may not be used at queries, and this my case: in my queries, metric options is not needed, want to use only labels. Tried use regex, not succeeded . My code is:

///
    + var.query.queryTypes.withLabelValues(
      'label',
      '',
///

after build via jsonnet become like this: "query": "label_values(, label)", and Grafana couldn't use it correctly, at variable interface i see this изображение

b0kky commented 10 months ago

great. thanks a lot. some note for others: if you already have jsonnetfile.json remove vendor folder and run jb update in folder with project, for using last version of grafonnet\libsonnet etc