ivbtar
ivbtar

Reputation: 879

Text/Html panel is not displaying embedded iframe in Grafana

I am using Grafana 7.5.2. 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. But not showing. I chabged 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 still it show below panel.

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

enter image description here

enter image description here

Upvotes: 1

Views: 7139

Answers (1)

Jan Garaj
Jan Garaj

Reputation: 28636

You need only (please use correct quotes):

<iframe src="http://www.google.com" width=670 height=510></iframe>

But you may have still many problems, e.g.:

  • if Grafana is loaded via https, then http iframe will be very likely blocked, e.g. Blocked loading mixed active content
  • iframed page also may have configuration to deny embeding, e.g. Google has usually header X-Frame-Options: SAMEORIGIN, which will block

It is good idea to check browser console, where you can have more details about blocked iframe loading.

See https://github.com/jangaraj/grafana-iframe

Upvotes: 3

Related Questions