Skip to content

Instantly share code, notes, and snippets.

@simonpasquier
Last active October 1, 2021 11:14
Show Gist options
  • Select an option

  • Save simonpasquier/7f00cc57f7b1cf06ec338ce56775e5db to your computer and use it in GitHub Desktop.

Select an option

Save simonpasquier/7f00cc57f7b1cf06ec338ce56775e5db to your computer and use it in GitHub Desktop.
Sample prometheus configuration for Jenkins
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
@fourirakbar
Copy link

Hi!
I wanna ask, how can I find a token of bearer_token ?

@LoveDuckie
Copy link

LoveDuckie commented Oct 1, 2021

Hi! I wanna ask, how can I find a token of bearer_token ?

  1. Log in to the user account that you wish to create a bearer token for.
  2. Click on "Configure"
  3. Under the section "API Token", just click "Add New Token" and follow the instructions.

@fourirakbar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment