jenkins_exporter
jenkins_exporter copied to clipboard
How to make dashbard in Grafana?
There is a Jenkins dashboard here: https://grafana.com/dashboards/306 However it does not seem to work with this plugin. Are there any docs as to what names / metrics are used and how to configure Grafana for this?
I can locally run curl 127.0.0.1:9118
and get a dump, but have no idea what / why the output is:
...
# HELP jenkins_job_last_unstable_build Jenkins build number for lastUnstableBuild
# TYPE jenkins_job_last_unstable_build gauge
# HELP jenkins_job_last_unsuccessful_build_fail_count Jenkins build fail counts for lastUnsuccessfulBuild
# TYPE jenkins_job_last_unsuccessful_build_fail_count gauge
# HELP jenkins_job_last_unsuccessful_build_total_count Jenkins build total counts for lastUnsuccessfulBuild
# TYPE jenkins_job_last_unsuccessful_build_total_count gauge
# HELP jenkins_job_last_unsuccessful_build_skip_count Jenkins build skip counts for lastUnsuccessfulBuild
# TYPE jenkins_job_last_unsuccessful_build_skip_count gauge
# HELP jenkins_job_last_unsuccessful_build_queuing_duration_seconds Jenkins build queuing duration in seconds for lastUnsuccessfulBuild
# TYPE jenkins_job_last_unsuccessful_build_queuing_duration_seconds gauge
# HELP jenkins_job_last_unsuccessful_build_duration_seconds Jenkins build duration in seconds for lastUnsuccessfulBuild
# TYPE jenkins_job_last_unsuccessful_build_duration_seconds gauge
...
The same issue also appeared on my side. waiting for the solution.
Its because, the dashboard is looking for some metrics which are not available in your datasource.
You have to insert these metrics (jenkins_job_building_duration_count, jenkins_job_queuing_duration, jenkins_job_queuing_duration_count,.......etc) to your grafana's datasource.
Or update the dashboard to using the similar metrics values like
jenkins_job_last_failed_build_duration_seconds{jobname="Var23TestJobName"}
jenkins_job_last_completed_build_timestamp_seconds{jobname="Var23TestJobName"}
.
.
.
eg:- Use jenkins_job_last_failed_build_duration_seconds instead of jenkins_job_building_duration_count