- deps.edn
-
juxt/crux-metrics {:mvn/version "{crux_version}-beta"}
- pom.xml
-
<dependency> <groupId>juxt</groupId> <artifactId>crux-metrics</artifactId> <version>{crux_version}-beta</version> </dependency>
Crux 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 crux-metrics
reporters, you will need to include the following dependency on crux-metrics
:
juxt/crux-metrics {:mvn/version "{crux_version}-beta"}
<dependency>
<groupId>juxt</groupId>
<artifactId>crux-metrics</artifactId>
<version>{crux_version}-beta</version>
</dependency>
You will also need to include dependencies for your individual reporters - these are outlined below.
The Crux metric reporters depend on a common metrics module:
{
"crux.metrics/metrics": { ... },
}
{:crux.metrics/metrics { ... }}
{:crux.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 crux-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"}
{
"crux.metrics.prometheus/reporter": { ... }
}
{:crux.metrics.prometheus/reporter { ... }}
{:crux.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"}
{
"crux.metrics.prometheus/http-exporter": { ... }
}
{:crux.metrics.prometheus/http-exporter { ... }}
{:crux.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"}
{
"crux.metrics.cloudwatch/reporter": { ... }
}
{:crux.metrics.cloudwatch/reporter { ... }}
{:crux.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. ["crux.tx" "!crux.tx.ingest"]
would ignore crux.tx.*
, except crux.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"}
{
"crux.metrics.jmx/reporter": { ... }
}
{:crux.metrics.jmx/reporter { ... }}
{:crux.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.
{
"crux.metrics.console/reporter": { ... }
}
{:crux.metrics.console/reporter { ... }}
{:crux.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.
{
"crux.metrics.csv/reporter": { ... }
}
{:crux.metrics.csv/reporter { ... }}
{:crux.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? These fine people already did:
James Henderson, Daniel Mason & Dan MasonEdit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close