server/requestJob: record metrics last
This ensures that only if the dequeuing is successful are metrics recorded.
This commit is contained in:
parent
ac642c3d70
commit
4621768c14
1 changed files with 3 additions and 2 deletions
|
|
@ -453,8 +453,6 @@ func (s *Server) requestJob(ctx context.Context, arch string, jobTypes []string,
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logrus.Errorf("error retrieving job status: %v", err)
|
logrus.Errorf("error retrieving job status: %v", err)
|
||||||
return
|
return
|
||||||
} else {
|
|
||||||
prometheus.DequeueJobMetrics(status.Queued, status.Started, jobType)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, depID := range depIDs {
|
for _, depID := range depIDs {
|
||||||
|
|
@ -474,6 +472,9 @@ func (s *Server) requestJob(ctx context.Context, arch string, jobTypes []string,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: Drop the ':$architecture' for metrics too, first prometheus queries for alerts and
|
||||||
|
// dashboards need to be adjusted.
|
||||||
|
prometheus.DequeueJobMetrics(status.Queued, status.Started, jobType)
|
||||||
if jobType == "osbuild:"+arch {
|
if jobType == "osbuild:"+arch {
|
||||||
jobType = "osbuild"
|
jobType = "osbuild"
|
||||||
} else if jobType == "osbuild-koji:"+arch {
|
} else if jobType == "osbuild-koji:"+arch {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue