Connect TimescaleDB and Grafana
Grafana ships with built-in Prometheus, PostgreSQL, Jaeger, and other data source plugins that allow you to query and visualize data from a compatible database. To add a data source in Grafana you must be signed as a user with organization administration role privileges.
To connect Grafana with TimescaleDB on Timescale Cloud, start by installing Grafana. For more information about installing Grafana, see the Grafana installation documentation.
Alternatively, to connect your Grafana service on MST with your TimescaleDB service on Timescale Cloud, create a Grafana service on MST. You can try it for free for 30 days.
This section shows you how to connect TimescaleDB on Timescale Cloud as a data source in Grafana.
Configure TimescaleDB as a data source
To configure TimescaleDB as a data source you need to create a service, and then configure TimescaleDB as the data source in Grafana.
Creating a TimescaleDB service
- Sign in to the Timescale Cloud portal.
- Click
Create service. - You can choose to build your service with or without demo data.
- Click
Download the cheatsheet. This.sqlfile contains the credentials that you require to configure TimescaleDB as a data source on Grafana.
Try for free on Timescale Cloud
Your Timescale Cloud trial is completely free for you to use for the first thirty days. This gives you enough time to complete all our tutorials and run a few test projects of your own.
Configuring TimescaleDB as data source
To configure TimescaleDB service on Timescale Cloud with your Grafana installation, log in to Grafana and proceed to step 5 in this procedure.
- In the MST account
Servicesview, click the name of your new Grafana service. - On the service details page, take a note of the
UserandPasswordfield for your service. - Click the link in the
Service URIfield to open Grafana. - Log in to Grafana with your service credentials.
- Navigate to
Configuration→Data sources. The data sources page lists previously configured data sources for the Grafana instance. - Click
Add data sourceto see a list of all supported data sources. - Type
PostgreSQLin the search field and clickSelect. - Configure the data source:
- In the
Namefield, type name that you would like for dataset on TimescaleDB. - In the
PostgreSQL Connectionsection, type theDatabase,User, andPasswordfields using the.sqlfile that you downloaded when creating the TimescaleDB service. - In the
Hosttype<HOST>:<PORT>from the.sqlfile that you downloaded. - Set
TLS/SSL Modeasrequire. - In
PostgreSQL detailsenableTimescaleDB - Click
Save & testbutton. If the connection is successfulDatabase Connection OKappears.
When you have configured TimescaleDB as a data source in Grafana, you can create panels that are populated with data using SQL.
