简体   繁体   English

Grafana模板

[英]Grafana Templating

I am wondering if there is a way to limit the number of rows generated from grafana templating. 我想知道是否有一种方法可以限制从grafana模板生成的行数。

I can have a drop down variable "$x"on my grafana page and I can select the row editor and say repeat row for every value under $x. 我可以在grafana页面上使用一个下拉变量“ $ x”,然后选择行编辑器,并对$ x下的每个值说出重复行。

Based on different criteria, I can have x anywhere between 1 and like 160 rows. 根据不同的标准,我可以在1到160行之间的任意位置设置x。 I need to only be looking at about 10 at a time. 我一次只需要看10个。 I am wondering if I can control the number of rows shown/change the rows shown somewhere in grafana. 我想知道是否可以控制显示的行数/更改grafana中某处显示的行。

I can manually select items from the $x drop down to show only a few items of course, but its a matter of selecting only say.. 10 items right when the page loads. 我可以从$ x下拉菜单中手动选择项目,以显示仅几项内容,但这只是选择说的问题。页面加载时恰好有10项。

Please let me know if I am not describing the problem correctly or if I need to clarify more. 如果我没有正确描述问题或需要进一步说明,请告诉我。

Thanks, Karan 谢谢,卡兰

As far as I know there is no direct option for this but there are some ways you may be able to achieve what you want. 据我所知,尚无直接选择,但有一些方法可以实现您想要的。

  1. You could select your ~10 default entries and then save the dashboard this will save the selected ones in the dashboards JSON. 您可以选择〜10个默认条目,然后保存仪表板,这会将选定的条目保存在仪表板JSON中。 (or modify the JSON of the dashboard directly) (或直接修改仪表板的JSON)
  2. You could use the regex field in the template settings to filter some of your values and split them in groups this way. 您可以使用模板设置中的regex字段来过滤您的某些值,并以这种方式将它们分成组。 (one variable per regex group) (每个正则表达式组一个变量)
  3. You could change your data in elasticsearch in order to use multiple fields where you can split on. 您可以在elasticsearch中更改数据,以便使用可以拆分的多个字段。
  4. see PR #5616 as @Daniel Lee mentioned 看到PR #5616就像@Daniel Lee提到的

In general I think you get a faster response to this in grafana directly at github. 总的来说,我认为您可以直接在github上的grafana中对此做出更快的响应。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM