Text/Html panel is not displaying embedded iframe in Grafana

  • What Grafana version and what operating system are you using?

Grafana 7.5.2.

  • What are you trying to achieve?

I created new panel with Text visualation as HTML.

<html>
<head></head>
<body>
<iframe src=“http://www.google.com” width = 670 height = 510 ></iframe>
</body>
</html>

It should display google page in panel.

  • How are you trying to achieve it?

  • What happened?

Not showing iframe remote page in panel. I changed below configurations but still not displaying page. It gives page not found 404 Error.

I changed /usr/share/grafana/conf/defaults.ini , also changed grafana.ini and restarted grafana server but stillk it show below panel.

enable_alpha = true
disable_sanitize_html = true
enable_alpha = true
allow_embedding = true
cookie_samesite = none

  • What did you expect to happen?

  • Can you copy/paste the configuration(s) that you are having problems with?

I changed /usr/share/grafana/conf/defaults.ini , also changed grafana.ini and restarted grafana server but stillk it show below panel.

enable_alpha = true
disable_sanitize_html = true
enable_alpha = true
allow_embedding = true
cookie_samesite = none

  • Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.

Page not found

404 Error

Chances you are on the page you are looking for.

0%

Sorry for the inconvenience

Please go back to your home dashboard and try again.

  • Did you follow any online instructions? If so, what is the URL?

The disable_sanitize_html setting is working otherwise you would just see the html as text and not a 404. The 404 is almost certainly happening due to a CORS error.

Google actually doesn’t allow iframing by anyone outside of Google so it won’t work (see this example on StackOverflow). If you change the src to a site that allows iframing then it should work.

Here is an example:

<html>
<head></head>
<body>
<iframe src="https://bbc.com" width="670" height="510"></iframe>
</body>
</html>
1 Like