How to share Grafana dashboard as embedded iframe?

I need to export dashboards/panels from Grafana to my website. I’ve found your tutorial for Prometheus and Grafana setup which works very well, but does not contain this feature in its configuration.

I found that I need to set allow_embedding to true, but don’t know how to achieve that in nixos.
I’ve tried to add:

services.grafana.extraOptions = {
      allow_embedding = "true";
    };

to my .nix config file, but nothing has changed in grafana settings after nixos-rebuild switch.

Has anyone experiences with this?

extraOptions takes capital snake case keys (those are injected as env var).
The allow_embedding flag is under security section, so your config should look like:

services.grafana.extraOptions.SECURITY_ALLOW_EMBEDDING = "true";

You can confirm the setting is properly applied by visiting your grafana admin interface (/admin/settings).

1 Like

Great, it works. Thank you.