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

auto-dashboards #41

Closed
ctrlok opened this issue Jan 28, 2014 · 7 comments · May be fixed by skmezanul/grafana#11, henrypan/grafana#13, E-LLP/grafana#10, skmezanul/grafana#14 or henrypan/grafana#16
Closed

auto-dashboards #41

ctrlok opened this issue Jan 28, 2014 · 7 comments · May be fixed by skmezanul/grafana#11, henrypan/grafana#13, E-LLP/grafana#10, skmezanul/grafana#14 or henrypan/grafana#16

Comments

@ctrlok
Copy link
Contributor

ctrlok commented Jan 28, 2014

Hi. Grafana rocks! Can you add auto dashboard based on each field in filter? Example:

def addrow()
  somefunc_adding_row
end
filter = someArray
filter.each do |servername| 
  addrow(servername)
end

I can write some cronjob for updating dashboard in elasticsearch, but it is not clean.
Thanks!

@torkelo
Copy link
Member

torkelo commented Jan 29, 2014

I have been thinking about this and it is definitely something that should be added in some form. Just to clarify what you mean (so we are talking about the same thing). How would the filters array look and do you want to be able to specify a metric template / script function to apply customizations?

Maybe something like this, if you save a graph with a template section [[server]] in a target then you could provide a special expand parameter array (either in the top filter section or as a querystring param) that would look for graphs containing a target with that template section and instead of replacing the template with the parameter (like the current template/filter feature works) duplicate the graph for each option in the array.

So if you had a graph with a target like this:
apps.[[server]].logins.count

and you provided a template array server=[server-01, server-02, server-03, server-04] then you would end up with 4 graphs for each option in the array. Is this what you mean?

@ctrlok
Copy link
Contributor Author

ctrlok commented Jan 29, 2014

Yes. This is what I mean. Thanks.

@torkelo
Copy link
Member

torkelo commented Feb 8, 2014

Have a look at the scripted dashboard feature: https://github.com/torkelo/grafana/wiki/Scripted-dashboards

@cjchand
Copy link
Contributor

cjchand commented Feb 20, 2014

I've been doing some hacking on taking a dashboard export (Save -> Advanced -> Export Schema) and massaging that into the scripted dashboard format.

The use case is a bit different than what you have above: Instead of kicking out duplicate panels for multiple hosts in one dashboard, I am creating a host-specific dashboard and using the name parameter of the URL to dictate which host to display the dashboard for.

For example:
http://grafana-host/#/dashboard/script/mongo-dashboard.js?name=mongo-1
and
http://grafana-host/#/dashboard/script/mongo-dashboard.js?name=mongo-2

are the exact same dashboard, with the same panels, metrics, and layout. The only thing that changes is which host's metrics we show in the dashboard.

Currently, the high-level process is:

  1. Build out a dashboard in the UI
  2. Once done, export that dashboard
  3. Use that exported JSON - plus a JS template and some Python I've created - to create a new .js file
  4. Upload that new .js file to /app/dashboards
  5. Then call the URL for the new scripted dashboard, adding the name parameter to show the dashboard for any given host.

Example use cases are:

  • Server-specific templates with metrics specific to that node type (web servers, DB servers, etc)
  • Generic "basics" template that applies to any host (e.g.: CPU, Memory, Disk, etc.)

When I get it to a sharable point (hopefully soon), would you prefer to just add the code to the Wiki, or do you want to keep it as part of the code base? My preference would be the latter, as I am sure it can be improved upon by others, but I am open to whatever you want.

@torkelo
Copy link
Member

torkelo commented Feb 20, 2014

I am not really sure what you want to add to wiki/codebase, the python & javascript template that can transform a dashboard into a scripted dashboard?

Your scenario sounds like you could use the built in templated dashboard feature (enable filtering in the dashboards settings / controls). In the end of this video I show how to create a templated dashboard: https://www.youtube.com/watch?v=OUvJamHeMpw

@cjchand
Copy link
Contributor

cjchand commented Feb 20, 2014

Ah, I didn't realize that existed. Thanks for pointing it out and apologies for not watching the video before.

Yes, that's nearly all of it - save the ability to specify the server by URL. The reason why that is important to me is it allows me to build URLs in other systems that would let them jump directly to a dashboard for that server. Please let me know if there's a way to pass a URL parameter into the filter.

Otherwise, this fits the bill.

Thanks again!

@torkelo
Copy link
Member

torkelo commented Feb 21, 2014

@cjchand i have created a new issue based on you suggestion (#123)

@torkelo torkelo closed this as completed Feb 21, 2014
@ghost ghost mentioned this issue Apr 29, 2014
Dieterbe pushed a commit to Dieterbe/grafana that referenced this issue May 12, 2015
bentranter pushed a commit to walmartlabs/grafana that referenced this issue May 15, 2017
roidelapluie added a commit to roidelapluie/grafana that referenced this issue Dec 24, 2017
maint: Singlestat: Support Transparent
simonpasquier pushed a commit to simonpasquier/grafana that referenced this issue Jul 17, 2020
owen-d added a commit to owen-d/grafana that referenced this issue Apr 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment