-
Bug
-
Resolution: Duplicate
-
Minor
-
None
-
Jenkins 2.222.4
Prometheus-plugin 2.0.6
The prometheus plugin reports negative build durations for some stages in our pipeline. We have a fairly complicated system though so it hard to determine how to reproduce these, but they continue to be an issue for us.
default_jenkins_builds_stage_duration_milliseconds_summary_count{jenkins_job="org/repo/develop",repo="repo",stage="Build Installer",} 71.0 default_jenkins_builds_stage_duration_milliseconds_summary_sum{jenkins_job="org/repo/develop",repo="repo",stage="Build Installer",} -8.26154386E9
Here is a graph of this build stage's average duration:
Using this query in grafana.
sum by (stage) (default_jenkins_builds_stage_duration_milliseconds_summary_sum{service="$service", jenkins_job="org/$repo/$branch"})/ sum by (stage) (default_jenkins_builds_stage_duration_milliseconds_summary_count{service="$service", jenkins_job="org/$repo/$branch"})