Prometheus Exporter for Bitbucket exposes Bitbucket metrics as JVM and application statistics to Prometheus.
...
- Global controls the Prometheus server's global configuration.
- Rule_files specifies the location of any rules that you want the Prometheus server to load.
- Scrape_configs controls what resources Prometheus monitors.
To enable Prometheus Exporter for Bitbucket so that it collects metrics and pulls it into Prometheus:
Use the following scrape_configs:
Code Block title prometheus.yml scrape_configs: - job_name: 'bitbucket' scheme: https #change to http if don't you have https metrics_path: '/<your_bitbucket_context_path>/plugins/servlet/prometheus/metrics' static_configs: - targets: ['myhost:1990']
For a complete specification of configuration options, see the Prometheus configuration documentation.
On the Prometheus Status >Targets page, select the Prometheus Exporter for Bitbucket endpoint to get the Prometheus metrics (see example below).
Build any of the available dashboards with the selected metrics.
Configuring a secret token (recommended)
Warning | ||
---|---|---|
| ||
Note that this plugin publicly exposes some sensitive data by default. The metrics page exposes the usernames for who logged in last and so on. We recommend that you enable token protection to make sure the public cannot view usernames. |
To configure a secret token:
...
Use this secret token in the following scrape_configs in the prometheus.yml configuration file:
Code Block | ||
---|---|---|
| ||
- job_name: 'bitbucket'
scheme: https #change to http if don't you have https
metrics_path: '/<your_bitbucket_context_path>/plugins/servlet/prometheus/metrics'
params:
token: ['1234567890'] # i'd reccomend use 128 symbol lenght long [A-Za-z0-9]
static_configs:
- targets: ['myhost:1990'] |
Prometheus metrics example
...
title | Prometheus Metrics Example |
---|
...
You can find more information about Prometheus Exporter for Bitbucket Pro here.
You can find more information about Prometheus Exporter for Bitbucket Lite here.
See also
Using Prometheus Exporter for Bitbucket
...