feat: Add owner to job metrics
Signed-off-by: Marcel Müller <marcel-mueller@gmx.de>
This commit is contained in:
parent
c8bdf373d3
commit
90fe8c9a57
3 changed files with 5 additions and 3 deletions
|
|
@ -366,9 +366,9 @@ This is one of the features in GARM that I really love having. For one thing, it
|
|||
|
||||
### Job metrics
|
||||
|
||||
| Metric name | Type | Labels | Description |
|
||||
|---------------------------|---------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------|
|
||||
| `garm_job_status` | Gauge | `job_id`=<job id> <br>`name`=<job name> <br>`status`=<job status> <br>`conclusion`=<job conclusion> <br>`runner_name`=<runner name> <br>`repository`=<repository> <br>`requested_labels`=<requested labels> | List of jobs and their status |
|
||||
| Metric name | Type | Labels | Description |
|
||||
|-------------------|-------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------|
|
||||
| `garm_job_status` | Gauge | `job_id`=<job id> <br>`workflow_job_id`=<workflow job id> <br>`scaleset_job_id`=<scaleset job id> <br>`workflow_run_id`=<workflow run id> <br>`name`=<job name> <br>`status`=<job status> <br>`conclusion`=<job conclusion> <br>`runner_name`=<runner name> <br>`owner`=<owner> <br>`repository`=<repository> <br>`requested_labels`=<requested labels> | List of jobs and their status |
|
||||
|
||||
### Github metrics
|
||||
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ var JobStatus = prometheus.NewGaugeVec(prometheus.GaugeOpts{
|
|||
"status",
|
||||
"conclusion",
|
||||
"runner_name",
|
||||
"owner",
|
||||
"repository",
|
||||
"requested_labels",
|
||||
})
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@ func CollectJobMetric(ctx context.Context, r *runner.Runner) error {
|
|||
job.Status, // label: status
|
||||
job.Conclusion, // label: conclusion
|
||||
job.RunnerName, // label: runner_name
|
||||
job.RepositoryOwner, // label: owner
|
||||
job.RepositoryName, // label: repository
|
||||
strings.Join(job.Labels, " "), // label: requested_labels
|
||||
).Set(1)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue