Set up TimescaleDB and Grafana
This tutorial uses Managed Service for TimescaleDB (MST) to set up your database, and to set up Grafana. You can create a free account to try it out.
Create a new service for Grafana
You need to sign in to your MST account to create a new service to run Grafana.
Creating a new service for Grafana
- Log in to your Managed Service for TimescaleDB account. By default, you start in the
Services
view, showing any services you currently have in your project. - Click
Create a new service
. In the
Select your service
section, clickTimescaleDB Grafana - Metrics dashboard
:
- In the
Select your cloud service provider
andSelect your cloud service region
sections, choose the provider and region that you prefer, or accept the default values. - In the
Select your service plan
section, clickDashboard-1
. In the
Provide your service name
section, type a name for your new service. In this example, we’ve usedgrafana-tutorial
.
When you are happy with your selections, click
Create Service
to go back
to theServices
view while your service is created. The status indicator saysRebuilding
while the service is created. It is ready for you to use when the indicator is green and saysRunning
. This usually takes a couple of minutes, but different clouds can vary. You can click the service name in the list to see more information and make changes.
Log in to your MST Grafana service
When your service is built, you can log and set up your data services.
Logging in to your MST Grafana service
- In the MST account
Services
view, click the name of your new Grafana service. On the service details page, take a note of the user name and password for your service, and click the link in the
Service URI
field to open Grafana:
- Log in to Grafana with your service credentials.
Connect Grafana to your TimescaleDB instance
Now you have your Grafana service up and running, you can configure Grafana to connect to your TimescaleDB instance.
Connecting Grafana to your TimescaleDB instance
- In Grafana, click
Configuration → Data Sources
in the left menu bar. Click
Add Data Source
and choose thePostgreSQL
option in the SQL group:
On the data sources configuration page, complete these details:
- In the
Name
field, type a name for the data source. In this example, we usedtsdb-grafana-tutorial
. - In the
Host
field, type the Service URI for your service, add a colon at the end, and then type the port number. In this example, we usedgrafana-tutorial-internal-90d0.a.timescaledb.io:443
- In the
Database
field, type the name of your Grafana service. In this example, we usedgrafana-tutorial
. - In the
User
field, type the user name for your Grafana service. In the
Password
field, type the password for your Grafana service.
- In the
In the
PostgreSQL details
section, in theTimescaleDB
field, toggle the switch on:
- Click
Save & Test
. You can confirm your data source is working by clickingBack
, and checking that your service is listed correctly.