Exploring alternatives to scripted dashboards

284 views
Skip to first unread message

jostein-ble...@telenor.com

unread,
Oct 1, 2020, 6:45:19 AM10/1/20
to grafana-d...@googlegroups.com, Roger...@telenor.com, Kristian...@telenor.com

Hi! Hope you all are doing well.

 

I’m sending you this email in reference to our post at the Grafana community sites (https://community.grafana.com/t/new-alternative-to-scripted-dashboards/36791/2) , and my colleagues tweet (https://twitter.com/kristianlyng/status/1308677123037630464) where he was asked to post this to your mailing list.

 

So, as you might have gathered, we are hoping to start a dialog around an alternative to scripted dashboards. We have some thoughts, which we have named “script hooks” and have written a proof of concept to better explain what we are thinking. Of course, nothing is set in stone, we are very much open for your feedback and are aware that our thought might not be feasible for some reason.

 

For context around who we are and what we are using Grafana for please check out our post to the Grafana community sites, where my colleague provides some insight.

 

For some sort of a proof of concept around this please refer to my Grafana fork:

 

What a user created script hook might look like (content of scriptHookPoc() func): https://github.com/josteinHellerud/grafana/blob/feature/scripthook/public/app/features/dashboard/state/scripthookpoc.ts

 

 

A way to set new variables through browser user input without exposing the main code base: https://github.com/josteinHellerud/grafana/blob/feature/scripthook/public/app/features/variables/editor/VariableEditorList.tsx

 

 

And, yes, I’m aware that this is probably all wrong when it comes to coding style, where the code should live and so on. I just had to make something that works, without spending too much time. I don’t expect the final result to look anything like this.

 

I’m adding a screenshot as well (se​e attachment). 

 

How can we start a dialog about this? We are prepared to do the coding our self, with your guidance. Would some of you be available for a video call next week perhaps?

 

Looking forward to hearing from you.

 

Best regards,

Jostein Hellerud

Telenor Norway

 


Screenshot 2020-10-01 at 09.56.20.png

Daniel Lee

unread,
Oct 12, 2020, 11:49:04 AM10/12/20
to Grafana Developers
Hi Jostein,

A video call to kick this off sounds like a good idea. What time of the day and which days this week would work for you?

As a company, we have been focusing more on the provisioning angle. Logic to build dashboards is done outside of Grafana - e.g. when spinning up a new cluster, the dashboards are dynamically created using jsonnet and the Grafonnet library (https://github.com/grafana/grafonnet-lib). Changes can be instantly applied using the Grizzly tool: https://github.com/grafana/grizzly See this blog post for more details on the mixins approach: https://grafana.com/blog/2018/09/13/everything-you-need-to-know-about-monitoring-mixins/

The k8s mixin is an example of building up a set of dashboards using this approach: https://github.com/kubernetes-monitoring/kubernetes-mixin Any customization would be done by changing the config and then apply the set of changes to your production environment: https://github.com/kubernetes-monitoring/kubernetes-mixin#customising-the-mixin

We are planning to add a dashboard schema to Grafana  to help make the code first approach much easier. This will also allow us to add a code first approach to creating dashboards in the Grafana UI - the user will be able to automatically convert a dashboard from json to jsonnet or python for Grafanalib (https://github.com/weaveworks/grafanalib). So more work on provisioning is on our roadmap already.

So my first question is if the provisioning workflow with jsonnet, Grafonnet and Grizzly would fit your use case? Do the topology lookups and the Grouping of interface lookups need to be done in real time when a user is using the dashboard or can they be done when provisioning the dashboards?

/Daniel Lee (Grafana Labs)

Jostein Hellerud

unread,
Oct 13, 2020, 2:19:26 AM10/13/20
to Grafana Developers
Hi, Daniel! 

Thanks for reaching out, and for a detailed response. 

To answer you first question; we have done a lot with Jsonnet and Grafonnet (but not Grizzly) already. These approaches took us some of the way, but as you touch upon, we need interface lookups in real time when user is navigating the dashboard(s). Love that you are working on these approaches though, because they do solve many use cases.

A video call would be great! I'm not sure what time zones you are at, but my entire Thursday and Friday is available for a call between 06:00 and 14:00 UTC. Is there a time one of those days that could work for you? 

/Jostein 

Daniel Lee

unread,
Oct 13, 2020, 4:07:44 AM10/13/20
to Jostein Hellerud, Grafana Developers
Hi Jostein,

I think either Thursday or Friday morning would work for me. I'll see if I can round up a few more people to attend. I'll send a meeting invite later today.

/Daniel

--
You received this message because you are subscribed to a topic in the Google Groups "Grafana Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/grafana-developers/9QtGq50DgZo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to grafana-develop...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/grafana-developers/c6918dab-dab6-4482-bbaa-878e47b16bf3n%40googlegroups.com.

Daniel Lee

unread,
Oct 13, 2020, 4:21:38 AM10/13/20
to Jostein Hellerud, Grafana Developers
Also, Torkel answered too but he answered in the thread started by Kristian. I know he has been thinking about this for a while as he considers the current scripted dashboards to be a dead-end - they were inherited from Kibana when Grafana was forked from it 6 years ago. He has some ideas but we can work together to get them more fully formed - which is always the hard part with ideas like this!

Jostein Hellerud

unread,
Oct 13, 2020, 7:29:35 AM10/13/20
to Grafana Developers
Sounds great!

Looking forward to hearing more about Torkels thoughts and meeting you all during our meeting. 

/Jostein

Torkel Ödegaard

unread,
Oct 13, 2020, 10:32:37 AM10/13/20
to Jostein Hellerud, Grafana Developers
Reposting to the right thread :) 

Hi, 

Doing a completely new take on scripted & dynamic dashboards has been a dream of mine for years. I have dreamed of a way to build truly dynamic dashboards where the queries are on the dashboard level and based on query results + logic can generate a dynamic layout suitable for that system state. 

Repeated panels is a feature I have never really liked. It has always felt backwards to me to have a data query that fills a variable option array that Grafana then use to repeat a panel, and for each repeated panel Grafana will then issue another data query (in some cases the same data query) to get the data to display FOR EACH panel. 

Making a dynamic script that built a dashboard.json scheme that included variables + panel queries felt similarly bad. The dynamic script would most likely also need to issue data queries to create a dynamic dashboard that would then issue further data queries once loaded (possibly the same queries). 

The solution for me feels like why not sidestep the whole dashboard.json creation process and have the script issue data queries and generate a dynamic live dashboard model. The script could then respond to user interactions to dynamically change the dashboard model. 

This is why the new react panels know nothing of query execution, they just get their data passed down via props. 

I started experimenting with this concept at a very basic conceptual level 2 weeks ago. SUPER DUPER early. Trying to figure out if creating a script that returns an observable screen, with observable panels & data is a good idea. And a concept that It think could be powerful is an ability to nest these scripted dashboards (scenes I call them). So you can create small reusable mini dashboards or workflows that you can embed in other scenes. 


The thing that I think will be the most challenging with this approach (Beyond making the scripts easy to write) is how to handle URL state so you can share a specific state. 

/Torkel 


You received this message because you are subscribed to the Google Groups "Grafana Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to grafana-develop...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/grafana-developers/e2f7ce0b-51c0-49bf-97df-53f6fd87a753n%40googlegroups.com.

Daniel Lee

unread,
Oct 15, 2020, 5:43:41 AM10/15/20
to Grafana Developers
Hi all,

Thanks for taking the time to meet up with us today. It is really helpful to hear more about real world use cases and looking forward to collaborating more with you all!


Here are my follow-up actions:

Cheers,
Daniel

Jostein Hellerud

unread,
Oct 22, 2020, 6:39:03 AM10/22/20
to Grafana Developers
Hi, everyone!

Thanks again for our meeting last week. 

We have created a first draft of the product design document. Its located here: https://docs.google.com/document/d/1-PI0PREgsMSSkUWnzaSThR3-U_zM8maIDxJ0f1l06FU/edit

We are looking forward to hearing your thoughts on it. 

Best regards,
Jostein Hellerud

Hugo Häggmark

unread,
Oct 23, 2020, 7:12:37 AM10/23/20
to Grafana Developers
Hi Jostein and thank you for the update,

I'm going to have a look at the design document first thing on Monday.

I wish you and everyone else a pleasant weekend!

All the best,

Hugo

jostein-ble...@telenor.com

unread,
Nov 2, 2020, 4:14:34 AM11/2/20
to grafana-d...@googlegroups.com

Hi, Hugo!


Thanks for the confirmation. Did you, or anyone else, get the time to look at the document last week? :) 


Should we schedule a new meeting to go through it and discuss where we go from here? 


Have a great Monday!


Best regards,

Jostein Hellerud


From: 'Hugo Häggmark' via Grafana Developers <grafana-d...@googlegroups.com>
Sent: 23 October 2020 13:12
To: Grafana Developers
Subject: Re: Exploring alternatives to scripted dashboards
 

jostein-ble...@telenor.com

unread,
Nov 9, 2020, 2:46:51 AM11/9/20
to grafana-d...@googlegroups.com

Hi, everyone! 


Our team has Wednesday 11:00 - 15:00 UTC (12:00 - 16:00 Norwegian) available. We suggest a meeting within that time slot - at a time that works for you. The purpose of that meeting would be to go through the design document, create a plan for where we go from here and how we can contribute.


What do you think? Would that work for you?


Hoping you all are well and have a pleasant Monday.


Best regards,

Jostein hellerud 


From: Hellerud Jostein Bleken
Sent: 02 November 2020 10:14
To: grafana-d...@googlegroups.com
Subject: Exploring alternatives to scripted dashboards
 

Torkel Ödegaard

unread,
Nov 10, 2020, 4:57:40 AM11/10/20
to Jostein Hellerud, Grafana Developers
Hi, 

Sorry for not responding earlier.

The design doc is great at describing the problems and use cases we need to solve. Our approach to solving this is quite ambitious, in taking a really different take on what a dashboard is, and what the runtime model for these new types of programmatic dashboards should be. It needs a lot of research and POC. To do this would require quite deep knowledge of RxJS and Grafana internals 

Here is where I started exploring this:  

But this is super early, and never got anything real working. 

Sadly I and the core frontend platform team has quite a full roadmap for Q4 (that extends the whole of January for us). So during this time, we won't have much time to explore this more or give much guidance on what you can do beyond experimenting yourself with similar approaches. 

After Q1 I hope we can carve out more time for this. 

Cheers
Torkel


jostein-ble...@telenor.com

unread,
Nov 13, 2020, 2:33:14 AM11/13/20
to tor...@grafana.com, grafana-d...@googlegroups.com

Hi,

 

Thank you for your reply. Great to hear that the design document could be of value.

 

Your approach to this problem is still very interesting to us and we would like to contribute as much as possible. We understand that we don’t possess the required knowledge to create something even remotely ready for production. That being said, we will likely experiment a bit with your branch to see if we are able to identify if this approach will solve our problems or not, but it is nice to know if we can expect to receive any feedback on it when we get stuck, or even from the community (for example on Slack).

 

With regards to your timeline, what are the likelihood for you starting this work in February? And furthermore, the likelihood of this being a part of the release in the spring 2021.  

 

Best regards,

Jostein Hellerud

Telenor Norway​



From: Torkel Ödegaard <tor...@grafana.com>
Sent: 10 November 2020 10:57
To: Hellerud Jostein Bleken
Cc: Grafana Developers

jostein-ble...@telenor.com

unread,
Jan 15, 2021, 2:31:01 AM1/15/21
to tor...@grafana.com, grafana-d...@googlegroups.com

Hi!


Happy new year - hope you all are doing well so far in 2021! 


I was hoping to get an update on your timeline for the "alternatives to scripted dashboards" project. It would also be relevant with any new thoughts you have on this since we last spoke, and if there is any way we can contribute. 


Looking forward to hearing from you!


Best regards,

Jostein Hellerud

Telenor Norway


From: Hellerud Jostein Bleken
Sent: 13 November 2020 08:33
To: Torkel Ödegaard

Torkel Ödegaard

unread,
Feb 12, 2021, 12:22:35 PM2/12/21
to Jostein Hellerud, Grafana Developers
Hi,

Sorry for the late reply. Sadly we have not had time to start on this project and we have just completed planning for v8 and its focus on new alerting, many new visualizations, shared panels, performance & streaming, installing plugins from the UI, new logs & tracking features, dashboard schema (aids programmatic definition of regular dashboard json files) left no room for this. 

Might still be room to do some research & POCs in the next 3-4 months but there is no guarantee. 

Only way that I can think to contribute is to come up with ideas & proof of concepts to programmatically define dynamic dashboards that are derived from query results, and that support dynamic drill down & contextual panels. 

/Torkel
Reply all
Reply to author
Forward
0 new messages