You can export your Timescale service telemetry to Prometheus.
Connect to the Timescale service as tsdbadmin (using psql or a similar tool).
Create a new user to scrape the metrics from the database using the required permissions:
a. Create a user named
monitoringwith the desired password by replacing
<password>:CREATE USER monitoring WITH PASSWORD '<password>';
monitoringuser:GRANT pg_read_all_stats to monitoring;
Install the postgresql_exporter on a host that you manage to connect to the Timescale service and collect telemetry. Below is an example using Docker to run postgresql_exporter:
Your exporter must be in the same AWS region as your database service. If you have databases in multiple regions, you can create multiple exporters.
make sure to replace
<PASSWORD>with the created password and
<TIMESCALE-HOST:PORT>with the timescale service host and port.docker run \-p 9187:9187 \-e DATA_SOURCE_NAME="postgres://monitoring:<PASSWORD>@<TIMESCALE-HOST:PORT>/tsdb?sslmode=require" \quay.io/prometheuscommunity/postgres-exporter
Once the postgresql_exporter is up and running, and successfully connected to the Timescale service, you can configure your Prometheus server to scrape the postgresql_exporter metrics endpoint. This endpoint exposes all the metrics provided by the exporter.
To view all the exposed metrics, execute curl on the same host:curl localhost:9187/metrics
Use the PostgreSQL dashboard to visualize the following metrics:
- Current QPS
- Fetched, Returned, Inserted, Updated, Deleted Rows
- Database Deadlocks and Conflicts
- Cache Hit Ratio
- Number of Active Connections
Furthermore, you can create custom dashboards tailored to your specific needs using the metrics obtained from the Timescale service.
Found an issue on this page?Report an issue!