Collecting Metrics

Tembo Cloud shows some database metrics on If you want to collect metrics from your database into your self-hosted metrics system, you can follow this guide.

Where to find your metrics

You can find your metrics on your database’s domain name with the /metrics path. You must provide a Tembo authentication token in order to access these metrics. You can generate a token in Tembo Cloud here.

# Your Tembo Cloud token

# Use the domain name from your Postgres connection string
curl -H "Authorization: Bearer ${TOKEN}" \

Configuring Prometheus

Prometheus is a metrics server which collects metrics on a schedule. To configure Prometheus to collect metrics from a Tembo Cloud instance, you must configure the target with the authentication token.

Here is a sample Prometheus configuration file:

  scrape_interval: 30s

  - job_name: 'example_target'
    scheme: https
      # Use the domain name from your Postgres connection string
      - targets: ['']
    metrics_path: '/metrics'
      type: Bearer
      # Replace by your Tembo cloud token
      credentials: < your token here >

You may also avoid including the token in your configuration file by loading it from a file. Please consult the Prometheus documentation for more information, specifically the authorization section of scrape_config.

Prometheus quick start

Follow this part of the guide to quickly understand how to connect a Prometheus server to Tembo Cloud by example.

To quickly get up and running with a local Prometheus server, you can follow these steps:

version: '3.7'
        image: prom/prometheus:v2.33.1
            - ./prometheus.yml:/etc/prometheus/prometheus.yml
            - '9090:9090'
            - '--config.file=/etc/prometheus/prometheus.yml'
  • Create a file prometheus.yml in the same directory with the Prometheus configuration. This should look like the configuration example in the previous section. Replace the target by your Postgres server’s domain name along with the token by your Tembo Cloud token.
  • Run docker-compose up

Within 30 seconds, you should be able to see Prometheus is collecting the metrics if you access the local Prometheus server in your web browser here: localhost:9090/targets.


chevron right arrow