Skip to content

Monitoring

The GreptimeDB exposes the Prometheus metrics, and the users can also use Prometheus to collect the metrics.

Promethues Configuration

Write a Prometheus configuration file and save it as prometheus.yml:

global:
  scrape_interval: 15s 

scrape_configs:
  - job_name: 'greptimedb'
    static_configs:
      - targets: ['localhost:4000']
global:
  scrape_interval: 15s 

scrape_configs:
  - job_name: 'greptimedb'
    static_configs:
      - targets: ['localhost:4000']

Start GreptimeDB and Prometheus

Binary

Use Binary to deploy Prometheus and GreptimeDB:

  1. Install GreptimeDB according to the documentation.

  2. Visit the official documentation for Prometheus to download the binary. Afterward, execute the following command:

./prometheus --config.file=prometheus.yml
./prometheus --config.file=prometheus.yml

Access Prometheus by entering localhost:9090 in your web browser.

Docker

Use Docker to deploy Prometheus and GreptimeDB:

  1. Install GreptimeDB according to the documentation.

  2. Start the Prometheus:

docker run \
  -p 9090:9090 \
  -v $(pwd)/prometheus.yml:/etc/prometheus/prometheus.yml \
  prom/prometheus
docker run \
  -p 9090:9090 \
  -v $(pwd)/prometheus.yml:/etc/prometheus/prometheus.yml \
  prom/prometheus

Kubernetes

  1. Install kube-prometheus-stack chart:
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm repo update
helm install prometheus prometheus-community/kube-prometheus-stack
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm repo update
helm install prometheus prometheus-community/kube-prometheus-stack
  1. Use gtctl to deploy GreptimeDB cluster:
gtctl cluster create mycluster -n default \
  --set cluster.prometheusMonitor.enabled=true \
  --set cluster.prometheusMonitor.path="/metrics" \
  --set cluster.prometheusMonitor.port="http" \
  --set cluster.prometheusMonitor.interval="30s" \
  --set cluster.prometheusMonitor.honorLabels=true \
  --set cluster.prometheusMonitor.labelsSelector.release="prometheus"
gtctl cluster create mycluster -n default \
  --set cluster.prometheusMonitor.enabled=true \
  --set cluster.prometheusMonitor.path="/metrics" \
  --set cluster.prometheusMonitor.port="http" \
  --set cluster.prometheusMonitor.interval="30s" \
  --set cluster.prometheusMonitor.honorLabels=true \
  --set cluster.prometheusMonitor.labelsSelector.release="prometheus"

Metrics Detail

You can check the output of curl http://<host>:<port>/metrics by getting the latest metrics of GreptimeDB. We will add more documents of the metrics sooner.

Frontend

KeyType
greptime_table_operator_ingest_rowscounter
greptime_servers_errorcounter
greptime_servers_http_requests_totalcounter
greptime_servers_postgres_connection_countgauge
greptime_servers_mysql_connection_countgauge
greptime_query_merge_scan_regionssummary
greptime_servers_http_sql_elapsedsummary
greptime_query_optimize_physicalplan_elapsedsummary
greptime_frontend_handle_sql_elapsedsummary
greptime_http_track_metricssummary
greptime_query_create_physicalplan_elapsedsummary
greptime_servers_mysql_query_elapsedsummary
greptime_servers_http_requests_elapsedsummary
greptime_query_execute_plan_elapsedsummary
greptime_catalog_kv_get_remotesummary
greptime_grpc_region_requestsummary
greptime_query_merge_scan_poll_elapsedsummary
greptime_catalog_kv_getsummary
greptime_table_operator_create_tablesummary

Datanode

KeyType
greptime_opendal_bytes_totalcounter
greptime_servers_http_requests_totalcounter
greptime_opendal_requests_totalcounter
greptime_catalog_catalog_countgauge
greptime_catalog_schema_countgauge
greptime_opendal_requests_duration_secondssummary
greptime_http_track_metricssummary
greptime_servers_http_requests_elapsedsummary

Meta

KeyType
greptime_meta_create_schemacounter
greptime_servers_http_requests_totalcounter
greptime_meta_create_catalogcounter
greptime_meta_heartbeat_connection_numgauge
greptime_meta_txn_requestsummary
greptime_meta_kv_requestsummary
greptime_meta_create_schemasummary
greptime_meta_create_catalogsummary
greptime_meta_handler_executesummary
greptime_servers_http_requests_elapsedsummary
greptime_http_track_metricssummary
greptime_meta_procedure_create_tablesummary
greptime_grpc_region_requestsummary