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.