steampipe plugin install grafana

Table: grafana_datasource - Query Grafana Datasources using SQL

Grafana is an open-source platform for data visualization, monitoring, and analysis. It allows you to query, visualize, alert on, and understand your metrics no matter where they are stored. A Grafana Datasource is a database or service that stores the data you want to visualize in Grafana.

Table Usage Guide

The grafana_datasource table provides insights into Datasources within Grafana. As a Data Analyst or DevOps engineer, explore datasource-specific details through this table, including its type, access mode, database name, and other configuration details. Utilize it to manage and monitor your data sources, ensuring they are correctly configured and functioning as expected.

Important Notes

  • You must specify the id in the where clause to query this table.

Examples

Get information for a data source

Explore which type of data source is being used in your Grafana setup by identifying it through a specific identifier. This can help in managing and troubleshooting your data visualization configurations.

select
id,
name,
datasource_type
from
grafana_datasource
where
id = 1;
select
id,
name,
datasource_type
from
grafana_datasource
where
id = 1;

Get configuration of a data source

Analyze the settings to understand the configuration of a specific data source in Grafana. This could be used to troubleshoot issues or optimize data source utilization.

select
name,
jsonb_pretty(json_data)
from
grafana_datasource
where
id = 1;
select
name,
json_data
from
grafana_datasource
where
id = 1;

Schema for grafana_datasource

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form, e.g. connection_name.
accesstextMethod of access to the source, e.g. proxy.
basic_authbooleanTrue if the data source uses basic authentication.
basic_auth_usertextUsername for basic authentication.
databasetextDatabase name for the data source, e.g. mydb.
datasource_typetextType of the data source, e.g. postgres.
idbigint=Unique identifier for the data source.
is_defaultbooleanTrue if this is the default data source.
json_datajsonbDetailed configuration for the data source.
nametextName of the data source.
org_idbigintUnique identifier of the Grafana organization for this data source.
secure_json_datajsonbSecure configuration for the data source.
urltextURL of the data source.
usertextUsername for the data source, e.g. myuser.

Export

This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.

You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh script:

/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- grafana

You can pass the configuration to the command with the --config argument:

steampipe_export_grafana --config '<your_config>' grafana_datasource