System Monitoring (Metrics for Prometheus)
In many projects, Prometheus and Grafana are used to monitor the deployed systems. Some metrics can also be queried from the BPC.
Endpoint and Security
As usual, metrics can be queried from Prometheus via the /metrics endpoint (http://localhost:8181/metrics).
However, the endpoint can only be accessed via Basic Authentication.
BPC Configuration: Basic Authentication
It is recommended to set the username and password via environment variables in the central configuration file bpc.env
. |
| |BPC.env [tabs,sync-group-id=os-tabs] ====== Unix systems ( ):: + Windows systems (BPC.env.cmd):: + ====== If no environment variables are set, the username and password for Basic Authentication are automatically written to the BPC configuration file when the BPC starts. In this case, is specified as the username and the password is generated randomly. If necessary, these values can also be adjusted directly in the file and will take effect after restarting Karaf or the BPC Core Bundle. de.Virtimo.BPC.core.cfg [source] [NOTE] ==== Use the following quick test to verify that access is possible: ==== === Prometheus Configuration: Basic Authentication To allow Prometheus to retrieve the BPC metrics protected by Basic Authentication, this must be specified in the Prometheus scrape configuration. See also
bpc.env.sh
export DE_VIRTIMO_BPC_CORE_DE_VIRTIMO_BPC_METRICS_BASIC_AUTH_USERNAME="virtimo"
export DE_VIRTIMO_BPC_CORE_DE_VIRTIMO_BPC_METRICS_BASIC_AUTH_PASSWORD="0e6a8052eb814aaea397c45f77bffcf7"
SET DE_VIRTIMO_BPC_CORE_DE_VIRTIMO_BPC_METRICS_BASIC_AUTH_USERNAME=virtimo
SET DE_VIRTIMO_BPC_CORE_DE_VIRTIMO_BPC_METRICS_BASIC_AUTH_PASSWORD=0e6a8052eb814aaea397c45f77bffcf7
|
It is strongly recommended that you do not make configuration changes directly in the Karaf configuration files at |
<BPC-INSTALL-DIR>/karaf/etc/de.virtimo.bpc.core.cfg
virtimo
.
... de.virtimo.bpc.metrics.basic_auth.username = virtimo de.virtimo.bpc.metrics.basic_auth.password = 0e6a8052eb814aaea397c45f77bffcf7 ...
curl "http://virtimo:0e6a8052eb814aaea397c45f77bffcf7@localhost:8181/metrics"
...
- job_name: 'bpc'
scrape_interval: 5s
basic_auth:
username: virtimo
password: 0e6a8052eb814aaea397c45f77bffcf7
static_configs:
- targets: ['localhost:8181']
labels:
alias: bpc1
...