...
Once collected in Prometheus you can filter all statistics and run queries on long running or size.
Example
...
metrics count web service calls
Below query returns the total count of all calls using the query (below uses the wildcard on the path attribute to filter web service calls out, you could filter further if required)
Code Block |
---|
webapp_metrics_filter_count{path=~"/openmeetings/services/.+"} |
Example metrics web service calls duration over 1 min time window and graphed
In order to get the duration for those calls you would take the sum (by a certain time period) divided by the count (by the same time period) and what you would get is:
...
Info |
---|
However this method only works if the relevant method is in a Spring Bean |
Example metrics type database simple count
Info |
---|
org_openmeetings_metrics_count{type="database"} |
You can obviously use the same way like above to plot those counts into duration and graph it.
Example metrics type application simple count
Application metrics based on manual metric
Unfortunate not all places in the code are spring beans. Also sometimes we have inner classes or similar issues.
In that case I've added a Util that you can add at the start and end of the Method invocation, to create another metric.
See: I collect: