Grafana canvas unable to load images as background

in tests involving Grafana versions 12.2.0 and 12.2.1 (k8s), PNG images copied to the folder /usr/share/grafana/public/img/bg to be used as backgrounds appear with an error in the canvas. In the logs, a 404 error is shown. Is there another way to add images as backgrounds in the canvas? I can’t use URLs due to firewall policies.

I tried mounting the folder as a hostPath, tried moving it using kubectl cp, validated all permissions, and still the image doesn’t load.

I am facing the same issue! Let me know if something worked out for you. Thanks

Modifying the grafana/public/img/bg/ directory containing the stock Grafana background images is not currently a supported way of adding images to Canvas, nor will it become supported in the future.

:nerd_face: :raising_hands: Very creative hack though, I’m impressed!

Please refer to our documentation on the supported way to add a custom background image to your Canvas, by URL:

https://grafana.com/docs/grafana/latest/visualizations/panels-visualizations/visualizations/canvas/

you can move you background img in build folder then it show , img are present in both folder /public/build/img/bg
and public/img/bg then it will show , i don’t know it is bug or something else but after inspect the icon p7 it will show path to build folder that why i moved img to build folder. then restart the grafana service it will work for you thanks

1 Like