Skip to main content

Grafana

Grafana is a comprehensive observability and analytics platform used for visualizing, monitoring, and analyzing metrics, logs, and data from multiple sources. It provides powerful dashboarding capabilities that enable organizations to create interactive visualizations and gain insights into their infrastructure, applications, and business metrics. This integration enables querying and managing Grafana's configuration, organizational structure, access controls, and monitoring resources.

CategoryObservability
DirectionQuery source
Sign-inAPI Key, Basic Authentication
Query languagesSQLite
Tables9
Query templates22
Websitegrafana.com

Before you start​

Huntbase can sign in to Grafana with any of these methods: API Key, Basic Authentication. Pick one, create the credential in Grafana, then keep it to hand for the Connect step.

API Key​

Grafana API token (or service account token) supplied as the auth value.

  1. In Grafana, click Administration in the left-side menu, then Users and access › Service accounts › Add service account.
  2. Enter a Display name and click Create.
  3. Assign the Viewer role with the role picker.
  4. Click Add service account token, enter a name, optionally click Set expiration date, then click Generate token. Copy the token. It is shown only once.

Permissions:

  • Viewer
Watch out for
  • Service account tokens have no expiration date by default. Grafana recommends setting one.

For the vendor's own instructions, see Grafana service accounts documentation.

tip

Use a dedicated, read-only credential for Huntbase where the product allows it. Huntbase only needs to read.

Connect Grafana​

  1. Go to Connections and click New connection, or click New connection on the Grafana product page.
  2. On Product, pick Grafana and choose the Owner.
  3. On Details, give the connection a Name and, optionally, a Description.
  4. On Connect, fill in the settings and credentials described below.
  5. On Verify, review the summary and click Create & check.

For everything else on the setup page — saving a draft, I'll do this later, and what each check result means — see Connections.

Settings​

Where your Grafana lives:

FieldRequiredNotes
Grafana URLYesThe root URL of your Grafana server, such as http://localhost:3000.

Credentials​

Choose a Method, enter a Credential label (for example Production), then fill in the fields for that method.

API Key​

FieldRequiredNotes
AuthenticationYesEither a service account token, or username:password for basic authentication. Secret — not shown again after you save it.

Basic Authentication​

FieldRequiredNotes
AuthenticationYesEither a service account token, or username:password for basic authentication. Secret — not shown again after you save it.

Query it​

Once connected, Grafana can serve these languages in a query tab, and Scout can use it when you ask in Auto:

LanguageUse it for
SQLiteSQL over the 9 tables listed below, alongside every other connected source.

Example: SQLite​

List all orgs — Explore the various organizations within your Grafana setup to understand their settings and configurations.

select
*
from
grafana_org;

Grafana ships with 22 query templates. Find them in Library › Queries — see Query templates.

Tables​

Grafana adds 9 tables. Browse their columns from Schema in the query bar's ⋯ menu.

All 9 tables
TableContains
grafana_alert_ruleAlert rules in the Grafana installation.
grafana_dashboardDashboards in the Grafana installation.
grafana_datasourceData sources in the Grafana installation.
grafana_folderFolders in the Grafana installation.
grafana_folder_permissionPermissions for a given Folder in the Grafana installation.
grafana_orgOrgs in the Grafana installation.
grafana_teamTeams in the Grafana installation.
grafana_team_memberMembers for a given Team in the Grafana installation.
grafana_userUsers in the Grafana installation.

Next steps​