What Grafana version and what operating system are you using?
Grafana * v9.0.3 (023f9251a9) on Mac OS
I am using grafana with influx db. Grafana is running on a remote server and I am accessing it trough an vpn.
What are you trying to achieve?
I am quite new to developing and im trying to setup a grafana snapshot api to send snapshots of my dashboard to customers. I am stuck on the very beginning and do not now very wel how to get started.
So far I have been able to write some python code to fetch the json code of my dashboard, but I have not yet found how to get a snapshot trough the api.
You would need some sort of browser-renderer to achieve that.
The API âsnapshotâ is a copy of the JSON which tells Grafana what to do to
create the dashboard; it is not the result of Grafana processing that JSON.
So is there no way to automate the snapshot procedure? What I basically want to do is to show the dashboard (which is the car battery charging state) to the customer when they submit their use information on our website, by generating a snapshot link. The dashboard should also be updating every couple of minutes so I would generate a new snapshot every new moment. Is there a better way to do this? Thank you for the advice
Pretty sure there are ways to automate this but it is outside of the scope of grafana. The other way is for you to give your customers view only access to their dashboards.
Or you can look at reporting if your grafana is enterprise.
So is there no way to automate the snapshot procedure?
You can most definitely automate the snapshot procedure, but what you will get
is not a screenshot, which is the word I would use for what you seem to be
trying to create.
What I basically want to do is to show the dashboard
In that case you need a browser, or some software which knows how to render
like a browser, even if it doesnât produce an image on a screen (maybe it
generates a PNG or a GIF instead).
(which is the car battery charging state) to the customer when they submit
their use information on our website, by generating a snapshot link.
I suggest you stop thinking of this image you want as a âsnapshotâ, because
that term means something entirely different in Grafana terms (and espcially if
you look at the API).
The dashboard should also be updating every couple of minutes so I would
generate a new snapshot every new moment.
Try doing some web searches for âheadless browserâ. I think itâll get you
further than trying to do this with Grafana itself. You still need Grafana to
create the dashboard HTML, but some other tool is going to turn that into an
image for you to show to the customer.
Oke thank you for the advice, I will look into those things. The reason I thought I could generate snapshots with an api as a screenshot is because when you share a dashboard on grafana and go to the snapshot option you get a link to the dashboard which you can then share with people outside the organisation, who would be the customer.
It is not a screenshot per se, it is like a read only view of the grafana dashboard. Is that what you want to share? as @pooh said you are using grafana exclusive terms and conflating them with your own terminology which is creating some confusion.
So yes you can share snapshots outside of grafana.
So this (HTTP Snapshot API | Grafana documentation ) is what I have been reading on and trying to understand for a while. What I do not understand is how do I work with this code? Can I just use it in python? And how do I adapt it for my own dashboard?
Thank you
I have been able to write some python code that works to generate a snapshot trough the api. The only problem I have now is that when I set âexternalâ to true such that it can be easily accessed outside the company, I get error messages. When I generate the dashboard locally it works. Can I solve this? it seems that there must be a solution for this since there is an option to generate the snapshot externally, as documented by grafana ( HTTP Snapshot API | Grafana documentation )