- deps.edn
-
com.xtdb/xtdb-metrics {:mvn/version "{xtdb_version}"}
- pom.xml
-
<dependency> <groupId>com.xtdb</groupId> <artifactId>xtdb-metrics</artifactId> <version>{xtdb_version}</version> </dependency>
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.
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 "{xtdb_version}"}
<dependency>
<groupId>com.xtdb</groupId>
<artifactId>xtdb-metrics</artifactId>
<version>{xtdb_version}</version>
</dependency>
You will also need to include dependencies for your individual reporters - these are outlined below.
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.
with-index-store-metrics?
(boolean, default true): includes index-store metrics in the metrics registry
with-query-metrics?
(boolean, default true): includes query metrics in the metrics registry
This reporter pushes metrics to a Prometheus 'Pushgateway' at regular intervals.
You will need to add the following dependencies, alongside xtdb-metrics
, in your project:
org.dhatim/dropwizard-prometheus {:mvn/version "2.2.0"}
io.prometheus/simpleclient_pushgateway {:mvn/version "0.8.1"}
io.prometheus/simpleclient_dropwizard {:mvn/version "0.8.1"}
io.prometheus/simpleclient_hotspot {:mvn/version "0.8.1"}
clj-commons/iapetos {:mvn/version "0.1.9"}
{
"xtdb.metrics.prometheus/reporter": { ... }
}
{:xtdb.metrics.prometheus/reporter { ... }}
{:xtdb.metrics.prometheus/reporter { ... }}
registry
(registry, defaults to shared registry)
push-gateway
(string, required)
report-frequency
(string/Duration
, default "PT1S"
)
prefix
(string): prefix all metric titles with this string
The Prometheus HTTP exporter starts a standalone server hosting Prometheus metrics.
org.dhatim/dropwizard-prometheus {:mvn/version "2.2.0"}
io.prometheus/simpleclient_dropwizard {:mvn/version "0.8.1"}
io.prometheus/simpleclient_hotspot {:mvn/version "0.8.1"}
io.prometheus/simpleclient_httpserver {:mvn/version "0.8.1"}
clj-commons/iapetos {:mvn/version "0.1.9"}
{
"xtdb.metrics.prometheus/http-exporter": { ... }
}
{:xtdb.metrics.prometheus/http-exporter { ... }}
{:xtdb.metrics.prometheus/http-exporter { ... }}
registry
(registry, defaults to shared registry)
port
(int, default 8080) port number for Prometheus client server.
jvm-metrics?
(boolean, default false): includes JVM metrics in the metrics dump
In addition to extra dependencies, you’ll need to ensure that your application has the cloudwatch:PutMetricData
permission.
io.github.azagniotov/dropwizard-metrics-cloudwatch {:mvn/version "2.0.3"}
software.amazon.awssdk/cloudwatch {:mvn/version "2.10.61"}
{
"xtdb.metrics.cloudwatch/reporter": { ... }
}
{:xtdb.metrics.cloudwatch/reporter { ... }}
{:xtdb.metrics.cloudwatch/reporter { ... }}
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 ignore xtdb.tx.*
, except xtdb.tx.ingest
dry-run?
(boolean, default false): reporter outputs to a local SLF4J logger instead
dry-run-report-frequency
(string/Duration
, default "PT1S"
)
io.dropwizard.metrics/metrics-jmx {:mvn/version "4.1.2"}
{
"xtdb.metrics.jmx/reporter": { ... }
}
{:xtdb.metrics.jmx/reporter { ... }}
{:xtdb.metrics.jmx/reporter { ... }}
registry
(registry, defaults to shared registry)
domain
(string): custom JMS domain
rate-unit
(TimeUnit
, default 'seconds'): unit to report rates
duration-unit
(TimeUnit
, default 'seconds'): unit to report durations
The console reporter logs metrics to standard-out at regular intervals.
It has no additional dependencies.
{
"xtdb.metrics.console/reporter": { ... }
}
{:xtdb.metrics.console/reporter { ... }}
{:xtdb.metrics.console/reporter { ... }}
registry
(registry, defaults to shared registry)
report-frequency
(string/Duration
, default "PT1S"
)
rate-unit
(TimeUnit
, default 'seconds'): unit to report rates
duration-unit
(TimeUnit
, default 'seconds'): unit to report durations
The CSV reporter logs metrics to a CSV file at regular intervals.
It has no additional dependencies.
{
"xtdb.metrics.csv/reporter": { ... }
}
{:xtdb.metrics.csv/reporter { ... }}
{:xtdb.metrics.csv/reporter { ... }}
registry
(registry, defaults to shared registry)
output-file
(string/File
/Path
, required)
report-frequency
(string/Duration
, default "PT1S"
)
rate-unit
(TimeUnit
, default 'seconds'): unit to report rates
duration-unit
(TimeUnit
, default 'seconds'): unit to report durations
Can you improve this documentation?Edit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close