The A1 Policy Management Service Spring Boot application exposes some management endpoints including loggers, metrics, Prometheus, and so on...
All these endpoints are enabled by Spring Boot Actuator dependency. When this dependency is added in pom.xml
, it will expose counters and statistics, which can then be managed from application.yaml
.
(See Kohn - Component configuration) for more details on configuration, and the application.yaml
file)
...... management: endpoints: web: exposure: # Enabling of springboot actuator features. See springboot documentation. include: "loggers,logfile,health,info,metrics,threaddump,heapdump,prometheus"......
The metrics
actuator makes several metrics available. These metrics include numerous built-in springboot metrics, and several new A1-specific metrics.
In order to access the exposed metrics, you need to form an URL and append metric's name end of the URL like below:
Prometheus Statistics
Prometheus is time-series database, which stores a sequence of data points, across time. It’s generally used to store metrics and performance data from your applications.
There are numerous predefined Prometheus statistics and counters, however we have added 3 new A1-specific metrics for the the A1 Policy Management Service:
total_ric_count
- Type
Guage
: The count of configuredric
s avaialble/used by the A1 Policy Management Service
- Type
total_policy_type_count
- Type
Guage
: The total count of available A1 Policy types
- Type
total_policy_count
- Type
Guage
: The total count of available A1 Policy instances
- Type
An example of Prometheus statistics:
Prometheus UI
If you want to collect and visualize Prometheus' statistics in Prometheus GUI, this can be configured in a 'prometheus.yml
' Prometheus configuration file, similar to the example below.
This sample shows how Prometheus can periodically scrape the available metrics and make them available.
For more information on how to use and configure Prometheus you can use these links to access Prometheus' page and instructions:
When Prometheus UI docker container is up and running, you can observe application state = "UP
".
To access metrics, you can use graph page and search for one of the existing metrics such as "total_policy_type_count
".
Another Prometheus metrics called "total_ric_count
" and "total_policy_count
" can be observed too.