public class MetricService extends Object
A metric is generated when a Imixs ProcessingEvent or Imixs DocumentEvent is fired. The service exports metrics in prometheus text format.
See: https://prometheus.io/docs/instrumenting/exposition_formats/ https://www.oreilly.com/library/view/prometheus-up/9781492034131/ch04.html
To avoid dependencies, we implement the prometheus exposition text format you ourself.
Mainly the adaper proivdes counter metrics about processed workitems. A coutner will always increase. To extract the values in prometheus use the rate fuction - Exmaple: rate(http_requests_total[5m]) See: https://www.robustperception.io/how-does-a-prometheus-counter-work
http://www.adam-bien.com/roller/abien/entry/monitoring_java_ee_appservers_with
http://www.adam-bien.com/roller/abien/entry/java_ee_6_observer_with| Constructor and Description |
|---|
MetricService() |
| Modifier and Type | Method and Description |
|---|---|
javax.ws.rs.core.Response |
getMetrics()
Get resource to export metrics in Prometheus text format
Example:
documents_total{method="load"} 66
workitems_processed_total{type="workitem",modelversion="auftrag-1.0.0",task="7000",event="10",workflowgroup="Auftrag",workflowstatus="Neuanlage"}
1
|
void |
init() |
void |
onDocumentEvent(org.imixs.workflow.engine.DocumentEvent documentEvent)
DocumentEvent listener to generate a metric.
|
void |
onProcessingEvent(org.imixs.workflow.engine.ProcessingEvent processingEvent)
ProcessingEvent listener to generate a metric.
|
@PostConstruct public void init()
public javax.ws.rs.core.Response getMetrics()
public void onProcessingEvent(@Observes
org.imixs.workflow.engine.ProcessingEvent processingEvent)
throws org.imixs.workflow.exceptions.AccessDeniedException
processingEvent - org.imixs.workflow.exceptions.AccessDeniedExceptionpublic void onDocumentEvent(@Observes
org.imixs.workflow.engine.DocumentEvent documentEvent)
throws org.imixs.workflow.exceptions.AccessDeniedException
documentEvent - org.imixs.workflow.exceptions.AccessDeniedExceptionCopyright © 2019 Imixs Software Solutions GmbH. All rights reserved.