I have Jenkins in https://jenkins.example.com
.
Plugin working witn 2 env. variables:
PROMETHEUS_ENDPOINT Configures rest endpoint. Defaults to "prometheus"
PROMETHEUS_NAMESPACE Configure prometheus metric namespace. Defaults to "default"
I need the metrics to be sent to https://jenkins.example.com/metrics
What PROMETHEUS_ENDPOINT
and PROMETHEUS_NAMESPACE
values?
Shortly: You actually don't need to edit this values. if you wish so you can configure them on:
Jenkins -> Manage Jenkins -> Configure System -> Promethues (section)
In short PROMETHEUS_ENDPOINT
using the GET Http request in order to get the index page of the jenkins metrics - https://<your-jenkins-path>/prometheus
Useful / Golden Tips for using jenkins prometheus plugin:
set parameter Enable authentication for prometheus end-point
to true
and you'll be able to get information about internal processes and jobs running on your jenkins endpoint.
create User account on jenkins dedicated to prometheus monitoring, create a token for authentication.
set screen privileges permissions for viewing jenkins metrics for this user:
For Enabling Metrics permission:
Managing jenkins -> Manage and assign roles -> Manage Roles -> Metrics (set view and health-check to true).
For Assign this permission to specific user: (your prometheus user) -
Managing jenkins -> Manage and assign roles -> Assign Roles -> find your user and add screen permission.
- job_name: 'jenkins' metrics_path: /prometheus scheme: http tls_config: insecure_skip_verify: true static_configs: - targets: ['company.jenkins.com:8080'] basic_auth: username: '[email protected]' password: 'abc123'
curl -u user:token jenkinsURL:port/prometheus/
for example:
curl -u [email protected]:abc123 company.jenkins.com:8080/prometheus/
http://yourPrometheusURL.com:9090/targets
and make sure your endpoint is up. you should get the metrics and start using it. Good Luck.