GeoMesa Metrics¶
GeoMesa provides integration with the DropWizard Metrics library for real-time
reporting with the geomesa-metrics
module.
Reporters are available for CloudWatch, Prometheus, Graphite, and SLF4J.
Configuration¶
Reporters are configured via TypeSafe Config. All reporters share a few common properties:
Configuration Property |
Description |
---|---|
|
The Java TimeUnit used to report rates, e.g |
|
The Java TimeUnit used to report durations, e.g. |
|
A fallback to use if |
|
How often the reporter should run, e.g. |
Logging Reporter¶
GeoMesa includes a logging reporter using SLF4J.
Configuration Property |
Description |
---|---|
|
Must be |
|
The name of the logger to use, e.g. |
|
The level to write out log messages at, e.g. |
Example configuration:
{
type = "slf4j"
units = "milliseconds"
interval = "60 seconds"
logger = "org.locationtech.geomesa.metrics"
level = "debug"
}
CloudWatch Reporter¶
The CloudWatch reporter can be included by adding a dependency on
org.locationtech.geomesa:geomesa-metrics-cloudwatch
. The CloudWatch reporter uses the default credentials
and region specified in your AWS profile config.
Configuration Property |
Description |
---|---|
|
Must be |
|
The CloudWatch namespace to use |
|
Boolean - report the raw value of count metrics instead of reporting only the count difference since the last report |
|
Boolean - POSTs to CloudWatch all values. Otherwise, the reporter does not POST values which are zero in order to save costs |
Example configuration:
{
type = "cloudwatch"
units = "milliseconds"
interval = "60 seconds"
namespace = "mynamespace"
raw-counts = false
zero-values = false
}
Prometheus Reporter¶
The Prometheus reporter can be included by adding a dependency on
org.locationtech.geomesa:geomesa-metrics-prometheus
. The Prometheus reporter supports normal Prometheus scraping
as well as the Prometheus Pushgateway. Note that the unit and interval configurations described above do not apply
to Prometheus reporters.
Prometheus Scraping¶
The standard Prometheus reporter will expose an HTTP endpoint to be scraped by Prometheus.
Configuration Property |
Description |
---|---|
|
Must be |
|
The port used to expose metrics |
|
A suffix to append to all metric names |
Example configuration:
{
type = "prometheus"
port = "9090"
}
Prometheus Pushgateway¶
For short-lived jobs, metrics can be sent to a Prometheus Pushgateway instead of being exposed for scraping.
Configuration Property |
Description |
---|---|
|
Must be |
|
The Pushgateway host |
|
The name of the batch job being run |
|
A suffix to append to all metric names |
Example configuration:
{
type = "prometheus-pushgateway"
gateway = "http://pushgateway:8080/"
job-name = "my-job"
}
Graphite Reporter¶
The Graphite reporter can be included by adding a dependency on
org.locationtech.geomesa:geomesa-metrics-graphite
.
Configuration Property |
Description |
---|---|
|
Must be |
|
The connection string to the Graphite instance |
|
Prefix prepended to all metric names |
|
Boolean to enable or disable SSL connections |
Example configuration:
{
type = "graphite"
url = "localhost:9000"
ssl = false
prefix = "example"
rate-units = "seconds"
duration-units = "milliseconds"
interval = "10 seconds"
}
If SSL is enabled, standard Java system properties can be used to control key stores and trust stores, i.e.
javax.net.ssl.keyStore
, etc.
Extensions¶
Additional reporters can be added at runtime by implementing
org.locationtech.geomesa.metrics.core.ReporterFactory
and registering the new class as a
service provider.
Micrometer Metrics¶
GeoMesa also has initial support for Micrometer metrics. Metric implementations can be configured at runtime through Typesafe Config:
org.locationtech.geomesa.metrics.micrometer.MicrometerSetup.configure()
Configuration should be under the key geomesa.metrics
, and takes the following config:
geomesa.metrics = {
reporters = []
instrumentations = {
# jvm classloader metrics
classloader = {
enabled = false
tags = {}
}
# jvm memory usage metrics
memory = {
enabled = false
tags = {}
}
# jvm garbage collection metrics
gc = {
enabled = false
tags = {}
}
# jvm processor usage metrics
processor = {
enabled = false
tags = {}
}
# jvm thread usage metrics
threads = {
enabled = false
tags = {}
}
}
}
The following reporters are supported:
Prometheus¶
{
type = "prometheus"
enabled = true
# use prometheus "standard" names - see https://docs.micrometer.io/micrometer/reference/implementations/prometheus.html#_the_prometheus_rename_filter
rename = false
common-tags = { "application" = "my-app" }
port = 9090
# additional config can also be done via sys props - see https://prometheus.github.io/client_java/config/config/
properties = {}
# omit if not using pushgateway
push-gateway = {
host = "localhost:9091"
job = "my-job"
scheme = "http"
format = "PROMETHEUS_PROTOBUF" # or PROMETHEUS_TEXT
}
}
Cloudwatch¶
{
type = "cloudwatch"
enabled = true
namespace = "geomesa"
# properties for the cloudwatch client
properties = {}
}