Ops Board Grafana Dashlet

Description

Visiting with a customer that uses the Operations Board with the URL Dashlet to view Grafana dashboards and it came to a request for an enhancement regarding authentication. The URL dashlet provides a basic auth functionality that doesn't work with Grafana so they have enabled an anonymous access capability in Grafana which is less than ideal.

This enhancement request is to provide a Dashlet that allows the user to use the Grafana API Key feature used by the "Grafana Box" that can be enabled on the home page. The dashlet should allow the user to specify the Dashboard in the properties list when configuring the dashboard. Potentially, being able to supply other configurable parameters such as time range or Quick Times to set the time context of the named dashboard.

Acceptance / Success Criteria

None

Attachments

2

Lucidchart Diagrams

Activity

Show:

Christian Pape April 11, 2017 at 9:08 AM

Added a Grafana dashlet. Unfortunately, the Grafana HTTP API allows only to
search for dashboards but not for panels or individual graphs. So, the dashlet
provides a simple configuration window for picking a dashboard and one of the
quick ranges.

Please review & merge:

Christian Pape April 5, 2017 at 9:41 AM

The problem is credentials in the URL like http://admin:secret@my-other-site.com?foo are deprecated and no longer in the protocol specs. Some browsers give you a phishing warning, other simply ignore these credentials which results in an unauthorized request. An approach could be to fill iFrames using AJAX requests by setting correct headers. But this will only work if the referenced App will permit it to be embedded somewhere else.

David Hustace April 5, 2017 at 8:49 AM

Seems the iFrame strategy causes the dashlets, especially the URL dashlets, troubles. I wonder if there is another approach we could use for embedding dashlets. I'm guessing it's not so easy since you've probably already given this considerable thought.

Christian Pape April 5, 2017 at 8:38 AM

Sorry, this seems not to work:

  • I tried to create a proxy servlet, but this will also require to alter the returned HTML code to point to the proxy's URL. Otherwise no referenced files will work.

  • I tried to create a custom servlet for redirecting to Grafana with the correct API-key set in the Authorization header. But these custom headers are not copied from the initial request to the redirect request.

  • I tried also to use an AJAX request (including Authorization header) to retrieve the Grafana page contents and put these into an iFrame. This failed due to CORS restrictions and Grafana does not allow to configure these headers without an proxying nginx.

I don't know why these Grafana guys allow to add, edit, delete all kind of data remotely via their HTTP API but they do not allow to embed dashboards in a simple reliable way.

Any ideas?

Christian Pape April 5, 2017 at 2:28 AM

This is not so easy. You can only pass an URL to an iFrame. The browser itself invokes the GET-request
to this URL. Unfortunately it seems that the Grafana API-key can't be used inside the URL. It's used via
header like Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk.

Fixed

Details

Assignee

Reporter

Components

Sprint

Fix versions

Affects versions

Priority

PagerDuty

Created March 15, 2017 at 1:16 PM
Updated April 19, 2017 at 7:44 PM
Resolved April 19, 2017 at 3:44 PM