worker: add metrics
use prometheus to gather metrics
This commit is contained in:
parent
b5987a5ca5
commit
4c800f29a7
468 changed files with 63476 additions and 2668 deletions
|
|
@ -19,6 +19,7 @@ import (
|
|||
"github.com/labstack/echo/v4"
|
||||
|
||||
"github.com/osbuild/osbuild-composer/internal/jobqueue"
|
||||
"github.com/osbuild/osbuild-composer/internal/prometheus"
|
||||
"github.com/osbuild/osbuild-composer/internal/worker/api"
|
||||
)
|
||||
|
||||
|
|
@ -300,6 +301,16 @@ func (s *Server) FinishJob(token uuid.UUID, result json.RawMessage) error {
|
|||
}
|
||||
}
|
||||
|
||||
var jobResult OSBuildJobResult
|
||||
_, _, err = s.JobStatus(jobId, &jobResult)
|
||||
if err != nil {
|
||||
return fmt.Errorf("error finding job status: %v", err)
|
||||
}
|
||||
|
||||
if jobResult.Success {
|
||||
prometheus.ComposeSuccesses.Inc()
|
||||
}
|
||||
|
||||
// Move artifacts from the temporary location to the final job
|
||||
// location. Log any errors, but do not treat them as fatal. The job is
|
||||
// already finished.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue