Learn how to access the TimescaleDB database in the United Manufacturing Hub using Grafana, and get the access credentials you need to connect to the database. This tutorial includes detailed instructions and tips for using UMHLens to find the necessary passwords.
3 minute read
The TimescaleDB database is a powerful tool for storing and querying time-series data in the United Manufacturing Hub (UMH). It is used to store data from industrial machines and other sources, and can be accessed using a variety of tools, including Grafana. In this tutorial, we will show you how to access the TimescaleDB database using Grafana, and provide some tips for getting the access credentials you need.
What is Grafana
Grafana is an open-source platform for visualizing and analyzing time-series data. It is widely used in the UMH to display data from the TimescaleDB database and other sources, and provides a variety of powerful features for creating custom dashboards and alerts.
Instructions for Accessing the TimescaleDB Database
To access the TimescaleDB database using Grafana, follow these steps:
Open Grafana in your web browser.
Click on the “Add data source” button in the left menu.
In the “Add data source” page, select “Postgres” from the dropdown menu.
In the “Name” field, enter a name for your data source (e.g. “TimescaleDB”).
In the “Host” field, enter the domain name or IP address of the server hosting the TimescaleDB database. This is typically united-manufacturing-hub.united-manufacturing-hub.svc.cluster.local:5432.
In the “Database” field, enter the name of the database you want to access. This is typically factoryinsight.
In the “User” field, enter the username for the database. This is typically factoryinsight.
In the “Password” field, enter the password for the database. If you are using the default password, this is changeme. If you have changed the password, use your changed password instead. If you want to take a look at all data using admin credentials, see the section below for more information on how to get the current password.
In the “SSL” field, select “Required” to enable SSL for secure communication with the database.
In the “TimescaleDB” field, select “Yes” to indicate that you are using a TimescaleDB database.
Click the “Save & Test” button to save your data source and test the connection.
How to get the access credentials for TimescaleDB?
To get the current password for the TimescaleDB database, follow these steps:
Open UMHLens on your computer. For more information on how to do this, see this tutorial.
On the left side of the interface, click on the “Secrets” tab.
In the middle of the screen, you will see a list of available Secrets. Locate the timescale-post-init-pw Secret and click on it.
In the “Secret Details” page, you will see a field called “PATRONI_SUPERUSER_PASSWORD”. This is the password for the TimescaleDB database, encoded in base64.
To view the actual password, click on the eye icon next to the “PATRONI_SUPERUSER_PASSWORD” field. This automatically decrypts the base64 encoded password..
Copy the password and use it in the “Password” field when adding the Postgres data source in Grafana (as described in the previous section). FOr this you also need to use the postgres user.