Last active
October 1, 2021 11:14
-
-
Save simonpasquier/7f00cc57f7b1cf06ec338ce56775e5db to your computer and use it in GitHub Desktop.
Sample prometheus configuration for Jenkins
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| global: | |
| scrape_interval: 10s | |
| evaluation_interval: 30s | |
| scrape_configs: | |
| - job_name: 'jenkins' | |
| metrics_path: '/prometheus/' | |
| scheme: https | |
| tls_config: | |
| insecure_skip_verify: true | |
| bearer_token: <INSERT TOKEN HERE> | |
| static_configs: | |
| - targets: ['jenkins-myproject.192.168.1.17.nip.io:443'] | |
| # The Prometheus metrics plugin exposes metrics with the "job" label which are transformed into "exported_job". | |
| # Turn them into "jenkins_job" instead. | |
| metric_relabel_configs: | |
| - action: replace | |
| source_labels: [exported_job] | |
| target_label: jenkins_job | |
| - action: labeldrop | |
| regex: exported_job |
Author
Hi!
I wanna ask, how can I find a token of bearer_token ?
Hi! I wanna ask, how can I find a token of bearer_token ?
- Log in to the user account that you wish to create a bearer token for.
- Click on "Configure"
- Under the section "API Token", just click "Add New Token" and follow the instructions.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
By default the Prometheus endpoint isn't protected but authn/authz can be enabled in the plugin's configuration. Then the user needs at least to get the Metrics/View permission to retrieve the metrics, and the Job/Read permission to get the build metrics.