Dolt's SQL server can optionally expose metrics through a Prometheus HTTP endpoint. You can enable the Prometheus HTTP endpoint by defining a metrics section in your YAML configuration. The following YAML configuration file shows a complete configuration file that enables Prometheus metrics on port 11228:

log_level: info

  name: root
  password: ""

  host: localhost
  port: 11227
  max_connections: 100
  read_timeout_millis: 28800000
  write_timeout_millis: 28800000

  labels: {}
  host: localhost
  port: 11228

Once you start a Dolt SQL server with the configuration above, you'll be able to view all the exposed metrics and their descriptions at http://localhost:11228/metrics. The metrics prefixed with dss_ are Dolt SQL server metrics, and metrics prefixed with go_ are Golang runtime metrics.

Important Dolt SQL Server Metrics

  • dss_concurrent_connections – Number of clients concurrently connected to this Dolt SQL server.

  • dss_concurrent_queries – Number of queries concurrently being run on this instance of Dolt SQL server.

  • dss_query_duration_bucket – Histogram buckets of Dolt SQL server query latencies.

  • dss_is_replica – Indicates if this Dolt SQL server is a replica. (Only exposed when replication is enabled)

  • dss_replication_lag – The replication lag in ms for this replica. (Only exposed when replication is enabled)

Important Go Runtime Metrics

  • go_gc_duration_seconds – Histogram buckets containing counts for different pause durations of garbage collection cycles.

  • go_gc_duration_seconds_count – The total number of seconds Dolt has spent performing garbage collection.

  • go_memstats_alloc_bytes – Number of bytes allocated and still in use.

Scraping with Prometheus

After you've inspected the metrics by manually looking the /metrics page, you can configure a Prometheus server to scrape that data so you can use the Prometheus web UI to explore your metrics. Here's an example Prometheus server configuration file showing how to configure metrics scraping for a Dolt SQL server with metrics exposed on port 11228:

  scrape_interval: 15s

  - job_name: "dolt-sql-server"
    - targets: ["localhost:11228"]

Other monitoring products, such as Datadog, can also be configured to scrape metrics from the Prometheus HTTP endpoint exposed by a Dolt SQL server.

Last updated