Set up the Grafana server
Ensure you have a running instance of Grafana. You can verify this by accessing your Grafana URL in a browser.
Modify the Grafana configuration file
- Access the Grafana configuration file : This file is typically located at C:\Program Files\GrafanaLabs\grafana\conf\grafana.ini Grafana installation (Windows).
- Open the configuration file : Open the grafana.ini file in a text editor.
- Locate the HTTP section : In the grafana.ini file, find the [server] section. If you can’t find it, you can search for server or scroll down to the relevant section.
- Enable Cross-Origin Resource Sharing (CORS) : In the [server] section, look for the allow_embedding setting. Set it to true:
[server]
Enable embedding of Grafana dashboards
allow_embedding = true
This allows Grafana to be embedded within an iframe.
Restart the Grafana server
For the changes to take effect, you need to restart the Grafana server. Go to services and restart grafana service.