I have a visual in grafana. I can manually go to the menu on the panel of grafana click share -> snapshot -> rendering and export the snapshot and then I can curl it using snapshot url. This works great. Is there a way I can script that in python?. Is there some api I can hit that will return png/jpg images from the graph panel of grafana dashboard?
I was googling around and it looks like there isn’t any way to gererate png/jpg images from the grafana dashboard periodically. if there is a way or any solution then please help me out
thanks in advance
I was playing this morning on the same issue and I’ve found an “automatic” solution. Basically, you have to play with the panelId parameter, each picture on a dashboard has its own. See the example:
I am trying to do the same thing here but what I get running the query like you wrote here is an HTML file, not a png file… the panelID and URL and all is OK, no auth issue. Do you know what I could be doing wrong?
This is the start of the file I get:
!(function() {
if ('PerformanceLongTaskTiming' in window) {
var g = (window.__tti = { e: [] });
g.o = new PerformanceObserver(function(l) {
g.e = g.e.concat(l.getEntries());
});
g.o.observe({ entryTypes: ['longtask'] });
}
})();
</script>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="viewport" content="width=device-width" />
<meta name="theme-color" content="#000" />
<title>Grafana</title>