Skip to content
Snippets Groups Projects

Add a job duration histogram metric

Merged Tomasz Maczukin requested to merge job-duration-histogram-metric into master
1 unresolved thread

What does this MR do?

Adds a histogram metric that tracks a duration of all finished jobs.

Example of the metric:

gitlab_runner_job_duration_seconds_bucket{runner="c8d11a2a",le="30"} 1
gitlab_runner_job_duration_seconds_bucket{runner="c8d11a2a",le="60"} 2
gitlab_runner_job_duration_seconds_bucket{runner="c8d11a2a",le="300"} 4
gitlab_runner_job_duration_seconds_bucket{runner="c8d11a2a",le="600"} 4
gitlab_runner_job_duration_seconds_bucket{runner="c8d11a2a",le="1800"} 4
gitlab_runner_job_duration_seconds_bucket{runner="c8d11a2a",le="3600"} 4
gitlab_runner_job_duration_seconds_bucket{runner="c8d11a2a",le="7200"} 4
gitlab_runner_job_duration_seconds_bucket{runner="c8d11a2a",le="10800"} 4
gitlab_runner_job_duration_seconds_bucket{runner="c8d11a2a",le="18000"} 4
gitlab_runner_job_duration_seconds_bucket{runner="c8d11a2a",le="36000"} 4
gitlab_runner_job_duration_seconds_bucket{runner="c8d11a2a",le="+Inf"} 4
gitlab_runner_job_duration_seconds_sum{runner="c8d11a2a"} 276.34266274099997
gitlab_runner_job_duration_seconds_count{runner="c8d11a2a"} 4

Why was this MR needed?

Adds another way to track the behavior of the Runner.

Are there points in the code the reviewer needs to double check?

Does this MR meet the acceptance criteria?

  • Documentation created/updated
  • Added tests for this feature/bug
  • In case of conflicts with master - branch was rebased

What are the relevant issue numbers?

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
347 354 },
348 355 []string{"runner"},
349 356 ),
357 jobDurationHistogram: prometheus.NewHistogramVec(
358 prometheus.HistogramOpts{
359 Name: "gitlab_runner_job_duration_seconds",
360 Help: "Histogram of job durations",
361 Buckets: []float64{30, 60, 300, 600, 1800, 3600, 7200, 10800, 18000, 36000},
  • mentioned in issue #29270

  • Please register or sign in to reply
    Loading