We successfully use Grafana to visualize the result of some SQL queries on Postgres. In one table we have a binary column (bytea) containing a PDF. See here for details on byeta: https://www.postgresql.org/docs/9.6/datatype-binary.html
We’d like to give the dashboard user the ability to click on a link/ icon… which then downloads the PDF. Alternatively opening a new tab and displaying the PDF directly is also fine ;-).
I am new to Grafana but I generally see two ways to achieve this behaviour:
- have an external web service which generates the PDF on request and include a link to that web service in the Grafana dashboard
- let Grafana somehow magically grab the binary PDF data from the database cell and “stream” it to the browser with the correct mime type so that the browser will either download or display the binary data.
I’d prefer the second solution since it doesn’t require a separate web service. I’ve seen that there are also scriptable dashboards so maybe this could help… Any ideas, suggestions, examples on how to download/ display a PDF without the extra web service?