Skip to content

Commit 90fe8c9

Browse files
SystemKeepergabriel-samfira
authored andcommitted
feat: Add owner to job metrics
Signed-off-by: Marcel Müller <marcel-mueller@gmx.de>
1 parent c8bdf37 commit 90fe8c9

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

doc/config.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -366,9 +366,9 @@ This is one of the features in GARM that I really love having. For one thing, it
366366

367367
### Job metrics
368368

369-
| Metric name | Type | Labels | Description |
370-
|---------------------------|---------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------|
371-
| `garm_job_status` | Gauge | `job_id`=&lt;job id&gt; <br>`name`=&lt;job name&gt; <br>`status`=&lt;job status&gt; <br>`conclusion`=&lt;job conclusion&gt; <br>`runner_name`=&lt;runner name&gt; <br>`repository`=&lt;repository&gt; <br>`requested_labels`=&lt;requested labels&gt; | List of jobs and their status |
369+
| Metric name | Type | Labels | Description |
370+
|-------------------|-------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------|
371+
| `garm_job_status` | Gauge | `job_id`=&lt;job id&gt; <br>`workflow_job_id`=&lt;workflow job id&gt; <br>`scaleset_job_id`=&lt;scaleset job id&gt; <br>`workflow_run_id`=&lt;workflow run id&gt; <br>`name`=&lt;job name&gt; <br>`status`=&lt;job status&gt; <br>`conclusion`=&lt;job conclusion&gt; <br>`runner_name`=&lt;runner name&gt; <br>`owner`=&lt;owner&gt; <br>`repository`=&lt;repository&gt; <br>`requested_labels`=&lt;requested labels&gt; | List of jobs and their status |
372372

373373
### Github metrics
374374

metrics/jobs.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ var JobStatus = prometheus.NewGaugeVec(prometheus.GaugeOpts{
3232
"status",
3333
"conclusion",
3434
"runner_name",
35+
"owner",
3536
"repository",
3637
"requested_labels",
3738
})

runner/metrics/jobs.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ func CollectJobMetric(ctx context.Context, r *runner.Runner) error {
4343
job.Status, // label: status
4444
job.Conclusion, // label: conclusion
4545
job.RunnerName, // label: runner_name
46+
job.RepositoryOwner, // label: owner
4647
job.RepositoryName, // label: repository
4748
strings.Join(job.Labels, " "), // label: requested_labels
4849
).Set(1)

0 commit comments

Comments
 (0)