Configure the CockroachDB data source
To install a data source, see Install Grafana plugins. For general information on adding a data source see Add a data source.
Only users with the organization administrator
role can add data sources. Administrators can also configure the data source via YAML with Grafana’s provisioning system.
To install the CockroachDB plugin, see Installation on the CockroachDB plugin page.
You will need your host URL, default database and authentication information. To find your host URL and default database log in to the CockroachDB Cloud Console, select your cluster and navigate to the Connection Info section. For SQL authentication you need your username and password, for Kerberos authentication you need your user name and credential cache path and for TLS/SSL authentication you need the file path or file content of a root certificate, client certificate and client key.
Configure the data source with provisioning
It is possible to configure data sources using configuration files with Grafana’s provisioning system. To read about how it works, including and all the settings that you can set for this data source, refer to Provisioning Grafana data sources.
Here are some provisioning examples for this data source:
- Using SQL authentication:
apiVersion: 1
datasources:
- name: CockroachDB
type: grafana-cockroachdb-datasource
jsonData:
url: your_host_url
database: your_default_database
user: your_user_name
secureJsonData:
password: your_password
- Using Kerberos authentication:
apiVersion: 1
datasources:
- name: CockroachDB
type: grafana-cockroachdb-datasource
jsonData:
url: your_host_url
database: your_default_database
user: your_user_name
credentialCache: your_credential_cache_file_path
configFilePath: /etc/krb5.conf (by default)
- Using TLS/SSL authentication:
NOTE: TLS values can be either a file path or the file content of the certificate and key
apiVersion: 1
datasources:
- name: CockroachDB
type: grafana-cockroachdb-datasource
jsonData:
url: your_host_url
database: your_default_database
user: your_user_name
secureJsonData:
tlsCACert: your_tls_ca_cert
tlsClientCert: your_tls_client_cert
tlsClientKey: your_tls_client_key
password: your_password