Skip to main content

Tracking Metrics with Prometheus

Prometheus offers a robust solution for real-time monitoring, empowering you to track critical metrics and maintain system stability effectively. This topic guides you through the steps to integrate Prometheus with Databend Cloud and provides an overview of the available metrics.

note

Tracking metrics with Prometheus is only available for Databend Cloud users on the Business and Dedicated plans.

Integrating with Prometheus

Follow these steps to set up a Prometheus instance with Docker and integrate it with Databend Cloud:

1

Prerequisites

  • To start tracking metrics, ensure that metrics are enabled for your Databend Cloud tenant. To enable this feature, submit a support ticket in Databend Cloud by navigating to Support > Create New Ticket and requesting metrics activation for your tenant.

  • This procedure explains how to set up a Prometheus instance using Docker. Ensure that the Docker Engine is installed on your machine before proceeding.

2

Prepare a SQL User

Create a dedicated SQL user in Databend Cloud for Prometheus to access metrics. For example, you can create a SQL user named metrics with the password metrics_password using the following SQL statement:

CREATE USER metrics IDENTIFIED BY 'metrics_password';
3

Start Prometheus Using Docker

  1. On your local machine, create a file named prometheus.yml to configure Prometheus for scraping metrics from Databend Cloud. Use the following template:
prometheus.yml
scrape_configs:
- job_name: databend-cloud
scheme: https
metrics_path: /metrics
basic_auth:
username: <USERNAME>
password: <PASSWORD>
scrape_interval: 10s
scrape_timeout: 3s
static_configs:
- targets:
- <TENANT_ENDPOINT>
labels: # Optional
tenant: <TENANT_ID>
platform: <PLATFORM>
region: <REGION>
PlaceholderDescriptionExample
<USERNAME>The username for the SQL user.metrics
<PASSWORD>The secure password for the SQL user.metrics_password
<TENANT_ENDPOINT>The endpoint URL for your Databend Cloud tenant.tnxxxxxxx.gw.aws-us-east-2.default.databend.com
<TENANT_ID>Your tenant's unique identifier.tnxxxxxxx
<PLATFORM>The cloud platform hosting the tenant.aws
<REGION>The region where the tenant is hosted.us-east-2
  1. Start Prometheus with the following command (replace </path/to/prometheus.yml> with the full path to your prometheus.yml file):
docker run -d \
--name prometheus \
-p 9090:9090 \
-v </path/to/prometheus.yml>:/etc/prometheus/prometheus.yml \
prom/prometheus
  1. Open Prometheus in your browser at http://localhost:9090, navigate to Status > Target health, and confirm that the databend-cloud target is listed with a status of UP.

alt text

You're all set! You can now query your tenant metrics directly from Prometheus. For example, try querying databend_cloud_warehouse_status:

alt text

Available Metrics List

Please note that all metrics are prefixed with databend_cloud_.

note

The metrics are in alpha state and may change over time. We recommend that you monitor the metrics closely and adjust your monitoring setup accordingly.

Query Metrics

The following is a list of query metrics available in Databend Cloud:

NameTypeLabelsDescription
query_countCountertenant,warehouseQuery counts made by clients
query_errorsCountertenant,warehouseQuery error counts made by clients
query_request_bytesCountertenant,warehouseQuery request bytes from client
query_response_bytesCountertenant,warehouseQuery response bytes sent to client

Storage Metrics

The following is a list of storage metrics available in Databend Cloud:

NameTypeLabelsDescription
storage_total_sizeGuagetenantTotal size for backend object storage
storage_staged_sizeGuagetenantTotal size for staged files on backend object storage
storage_table_compressed_sizeGuagetenantTotal size for current tables backend object storage
storage_non_current_sizeGuagetenantTotal size for non-current objects in backend storage

Warehouse Metrics

The following is a list of warehouse metrics available in Databend Cloud:

NameTypeLabelsDescription
warehouse_statusGuagetenant,warehouse,size,statusFlag for warehouse status (Suspended,Running, etc.)
warehouse_connectionsGuagetenant,warehouseSession Count currently
warehouse_queries_queuedGuagetenant,warehouseQueries waiting in queue currently
warehouse_queries_runningGuagetenant,warehouseQueries running currently
warehouse_queries_start_totalCountertenant,warehouseQueries started total
warehouse_queries_failed_totalCountertenant,warehouseQueries failed total
warehouse_queries_success_totalCountertenant,warehouseQueries success total
warehouse_storage_requests_totalCountertenant,warehouse,scheme,opRequests count to backend storage
warehouse_storage_requests_bytesCountertenant,warehouse,scheme,opRequests bytes from backend storage
warehouse_data_scan_rowsCountertenant,warehouseData rows scanned from backend storage
warehouse_data_write_rowsCountertenant,warehouseData rows written to backend storage

Task Metrics

The following is a list of task metrics available in Databend Cloud:

NameTypeLabelsDescription
task_scheduled_totalCountertenant,taskTotal scheduled tasks
task_query_requests_totalCountertenant,taskQuery requests for tasks
task_run_skipped_totalCountertenant,taskSkipped task runs
task_accessor_requests_totalCountertenant,functionAccessor requests for tasks
task_notification_success_totalCountertenantSuccessful task notifications
task_notification_errors_totalCountertenantTask notification errors
task_running_duration_secondsCountertenant,taskTask running duration in seconds
task_runningCountertenant,taskRunning tasks
task_scheduled_timestampCountertenant,taskScheduled task timestamps