Chore(metrics): gitlab_runner_jobs_total init value
What does this MR do?
Sets the default value for the gitlab_runner_jobs_total counter.
Why was this MR needed?
On GitLab.com monitoring we are looking at this metric, compare it to a previous reading from an hour ago, and make an alerting decision based on that. If the metric disappears because of the runner process restart (which must happen when we, for example, update runner's version), then the alert is triggered creating a false feeling of an ongoing problem.
What's the best way to test this MR?
# First register the runner
❯ ./out/binaries/gitlab-runner-darwin-arm64 register (...)
# Start the runner, no jobs need to be executed
❯ ./out/binaries/gitlab-runner-darwin-arm64 run --listen-address=0.0.0.0:12345
# Check the metric
❯ curl localhost:12345/metrics -sS | grep jobs_total
# HELP gitlab_runner_jobs_total Total number of handled jobs
# TYPE gitlab_runner_jobs_total counter
gitlab_runner_jobs_total{runner="LhBC3aIs6",runner_name="faleksic-runner",system_id="s_6616bed0d510"} 0
What are the relevant issue numbers?
Resolves #38925 (closed)