Metrics
SWF can be configured to export metrics like CPU, memory, threads, Vert.x workers, etc. The data will be exported to both ElasticSearch or Prometheus database and both can be used simultaneously. If ElasticSearch is configured data will be pushed to the database, if Prometheus is configured data will be pulled from SWF using the /metrics
endpoint.
Example configuration
{
"metrics": {
"enabled": true | false,
"enableClassLoaderMetrics": true | false,
"enableJvmGcMetrics": true | false,
"enableJvmMemoryMetrics": true | false,
"enableJvmThreadMetrics": true | false,
"enableProcessorMetrics": true | false,
"enableVertxMetrics": true | false,
"commonTags": {
"tagName": "myApplication"
},
"elasticSearch": {
"autoCreateIndex": true | false,
"enabled": true | false,
"host": "http://localhost:9200",
"password": "myPassword",
"step": "PT10S",
"username": "myUsername"
},
"prometheus": {
"enabled": true | false,
"publishQuantiles": true | false
}
}
}
Click to copy
-
enabled
- Whether the metrics functionality should be enabled -
enableClassLoaderMetrics
- Enabling class loader metrics -
enableJvmGcMetrics
- Enabling JVM GC metrics -
enableJvmMemoryMetrics
- Enabling JVM memory metrics -
enableJvmThreadMetrics
- Enabling JVM thread metrics -
enableProcessorMetrics
- Enabling processor metrics -
enableVertxMetrics
- Enabling Vert.x metrics -
commonTags
- If you want to add tags to your data. Name your tag and value in the JSON object, like in the example configuration above -
elasticSearch
- ElasticSearch configuration -
prometheus
- Prometheus configuration. Prometheus will use the/metrics
endpoint to gather information