user1574808
user1574808

Reputation: 737

How to do Grafana Dynamic Singlestat Panels?

I've got metrics in Graphite showing response time for various organizations. The list of organizations can change on the fly. I want panels in Grafana to appear for any origanization who's response time is over a certain threshold. Was thinking the Singlestat panels was the right panel to use. Question is how to make them appear dynamically? Is a scripted dashboard the right approach?

If a scripted dashboard is the correct solution, can anyone recommend a Grafana cloud/service provider that supports scripted dashboards? The current one I have been testing out does not support scripts. Note that I am not really tied to Graphite as the backend since this project is in proof of concept phase. Just need the backend to also be a service. Don't want to roll the backend myself. Thanks.

Upvotes: 1

Views: 5840

Answers (1)

JeanFred
JeanFred

Reputation: 321

As far as I know, it is not possible right now.

We had a similar use case in my organisation, and here is what we did.

You can define a template variable for your organizations, and then use SingleStat panel with “Repeat Panel” on this variable, but that will display panels for all of your organizations. Filtering based on a criteria is a requested feature.

Alternatively, you can use the Table panel for your use case.

  • Choose Table panel
  • In “Metrics”, enter your metric organizations.*.response_time (or whatever more complicated you need, applyByNode can be handy for such cases)
  • In “Options”
    • “To Table Transform”: choose “Time Series aggregations”
    • “Columns”: Avg, or Current (depending on your needs)
    • “Coloring”: use thresholds to paint in red or something anything above your desired response-time threshold.
    • Sort the Table per the Number column.

Ta-da! Your organisations needing attention will be at the top of the table and highlighted.

In the lack of true filtering, this worked for us. Hope it will work for you too :)

Upvotes: 3

Related Questions