How to display images from URL?

I have a query which returns an image URL. Is there any way of displaying the image in a panel? I thought the AJAX panel would be able to achieve this but it doesn’t allow you to pass the query result into the GET request. Is there any way of saving the query result (a URL) as a local variable and passing it into the GET request?

I have successfully displayed images in the table panel (at least the old table panel from 6.7.x, I have not yet tried the new v7 table panel as it has too many bugs) using MySQL as the source anyway.

You can do it by selecting html so you select something like
CONCAT('<img src="', image_url, '" height="200">') as 'image'

Then you add a custom column style and turn on Sanitize HTML and Grafana will render the HTML img tag.

If you also turn on Render value as link and add a link using ${__cell_7:raw} (in this case the 7th cell returns the path to the image which is a hidden cell) the image becomes clickable (e.g. to open full-size).

1 Like