Monitoring
XTDB can expose metrics about a node via Dropwizard to Prometheus, AWS’s CloudWatch, and Java’s JMX.
We expose metrics about transaction ingestion and running queries. If you use RocksDB you can also expose internal RocksDB metrics.
Project Dependency
In order to use any of the xtdb-metrics
reporters, you will need to include the following dependency on xtdb-metrics
:
com.xtdb/xtdb-metrics {:mvn/version "1.23.1"}
<dependency>
<groupId>com.xtdb</groupId>
<artifactId>xtdb-metrics</artifactId>
<version>1.23.1</version>
</dependency>
You will also need to include dependencies for your individual reporters - these are outlined below.
Metrics module
The XTDB metric reporters depend on a common metrics module:
{
"xtdb.metrics/metrics": { ... },
}
{:xtdb.metrics/metrics { ... }}
{:xtdb.metrics/metrics { ... }}
You can omit this if you’re happy with its default parameters.
Prometheus reporter
Prometheus HTTP exporter
AWS Cloudwatch
In addition to extra dependencies, you’ll need to ensure that your application has the cloudwatch:PutMetricData
permission.
Parameters
-
registry
(registry, defaults to shared registry) -
high-resolution?
(boolean, default false): increase push rate from 1 minute to 1 second -
dimensions
(Map<String, String>
): dimensions to include in the pushed metrics -
jvm-metrics?
(boolean, default false): includes JVM metrics in the pushed metrics -
region
(string): override default AWS region for uploading metrics -
ignore-rules
(List<String>
): a list of metrics to ignore, in gitignore format. e.g.["xtdb.tx" "!xtdb.tx.ingest"]
would ignorextdb.tx.*
, exceptxtdb.tx.ingest
-
dry-run?
(boolean, default false): reporter outputs to a local SLF4J logger instead -
dry-run-report-frequency
(string/Duration
, default"PT1S"
)