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
Servicesview, showing any services you currently have in your project. - Click
Create a new service. - In the
Select your servicesection, clickTimescaleDB Grafana - Metrics dashboard:

- In the
Select your cloud service providerandSelect your cloud service regionsections, choose the provider and region that you prefer, or accept the default values. - In the
Select your service plansection, clickDashboard-1. - In the
Provide your service namesection, type a name for your new service. In this example, we’ve usedgrafana-tutorial.

- When you are happy with your selections, click
Create Serviceto go back to theServicesview while your service is created. The status indicator saysRebuildingwhile 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
Servicesview, 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 URIfield 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 Sourcesin the left menu bar. - Click
Add Data Sourceand choose thePostgreSQLoption in the SQL group:

-
On the data sources configuration page, complete these details:
-
In the
Namefield, type a name for the data source. In this example, we usedtsdb-grafana-tutorial. - In the
Hostfield, 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
Databasefield, type the name of your Grafana service. In this example, we usedgrafana-tutorial. - In the
Userfield, type the user name for your Grafana service. -
In the
Passwordfield, type the password for your Grafana service.
-
In the
PostgreSQL detailssection, in theTimescaleDBfield, 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.
