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 thewhere
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_typefrom grafana_datasourcewhere id = 1;
select id, name, datasource_typefrom grafana_datasourcewhere 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_datasourcewhere id = 1;
select name, json_datafrom grafana_datasourcewhere id = 1;
Schema for grafana_datasource
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form, e.g. connection_name. | |
access | text | Method of access to the source, e.g. proxy. | |
basic_auth | boolean | True if the data source uses basic authentication. | |
basic_auth_user | text | Username for basic authentication. | |
database | text | Database name for the data source, e.g. mydb. | |
datasource_type | text | Type of the data source, e.g. postgres. | |
id | bigint | = | Unique identifier for the data source. |
is_default | boolean | True if this is the default data source. | |
json_data | jsonb | Detailed configuration for the data source. | |
name | text | Name of the data source. | |
org_id | bigint | Unique identifier of the Grafana organization for this data source. | |
secure_json_data | jsonb | Secure configuration for the data source. | |
url | text | URL of the data source. | |
user | text | Username 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