7.14. Data Store Metrics¶
GeoMesa has initial support for Micrometer metrics. Currently, metrics can integrate with either Prometheus or Cloudwatch. Creating registries is idempotent, as long as the configuration does not change.
Most GeoMesa data stores support the parameters geomesa.metrics.registry and geomesa.metrics.registry.config, which are
used to start up a registry for publishing metrics. Configuration is described below.
When enabled, various GeoMesa components will publish metrics, including the Kafka Data Store and GeoMesa Converters.
7.14.1. Prometheus Registry¶
The Prometheus registry can be configured through the following environment variables:
Environment Variable |
Default |
Description |
|---|---|---|
|
true |
Rename metrics |
|
geomesa |
Add a tag for |
|
9090 |
Set the port used to host metrics |
Instead of environment variables, the registry can be fully configured using using the data store parameter
geomesa.metrics.registry.config, which takes Lightbend Config:
# port used to serve metrics - not used if push-gateway is defined
port = 9090
# tags applied to all metrics, may be any key-value string pairs
common-tags = { "application" = "my-app" }
# use prometheus "standard" names - see https://docs.micrometer.io/micrometer/reference/implementations/prometheus.html#_the_prometheus_rename_filter
rename = false
# additional config - can also be done via sys props, see https://prometheus.github.io/client_java/config/config/
properties = {}
# optional - enable pushgateway for short-lived jobs, instead of the standard metrics server for scraping
push-gateway = {
host = "localhost:9091"
job = "my-job"
scheme = "http"
format = "PROMETHEUS_PROTOBUF" # or PROMETHEUS_TEXT
}
If using Pushgateway, the following dependency is required:
<dependency>
<groupId>io.prometheus</groupId>
<artifactId>prometheus-metrics-exporter-pushgateway</artifactId>
<version>1.4.3</version>
</dependency>
7.14.2. Cloudwatch Registry¶
The Cloudwatch registry can be configured through the following environment variables:
Environment Variable |
Default |
Description |
|---|---|---|
|
geomesa |
Cloudwatch namespace |
Instead of environment variables, the registry can be fully configured using using the data store parameter
geomesa.metrics.registry.config, which takes Lightbend Config:
# cloudwatch namespace
namespace = "geomesa"
# properties for the cloudwatch client
properties = {}
For Cloudwatch, the following dependency is required:
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-cloudwatch2</artifactId>
<version>1.16.0</version>
</dependency>
7.14.3. Instrumentations¶
When adding a registry, additional JVM metrics can be exposed with the following environment variables:
Environment Variable |
Default |
Description |
|---|---|---|
|
true |
Enable all JVM instrumentations |
Individual instrumentations can be enabled or disabled through the following environment variables:
Environment Variable |
Default |
Description |
|---|---|---|
|
Enable metrics on JVM class loading |
|
|
Enable metrics on JVM memory usage |
|
|
Enable metrics on JVM garbage collection |
|
|
Enable metrics on processor usage |
|
|
Enable metrics on JVM thread usage |
|
|
Enable metrics on Apache commons-pool pools |
|
|
Enable metrics on PostgreSQL |
Or, when using geomesa.metrics.registry.config, use the following keys:
# tags are key-value string pairs added to metrics from the given instrumentation
classloader = { enabled = true, tags = {} }
memory = { enabled = true, tags = {} }
gc = { enabled = true, tags = {} }
processor = { enabled = true, tags = {} }
threads = { enabled = true, tags = {} }
commons-pool = { enabled = true, tags = {} }
postgres = { enabled = true, tags = {} }
Note
PostgreSQL metrics are only available in the Partitioned PostGIS Data Store.
7.14.4. Custom Registries¶
If the provided registries are not sufficient, metrics can be exposed by programmatically adding any Micrometer registry to the global registry.