@@ 9,6 9,7 @@ require (
github.com/gocelery/gocelery v0.0.0-20201111034804-825d89059344 // indirect
github.com/google/uuid v1.0.0 // indirect
github.com/lib/pq v1.8.0 // indirect
+ github.com/prometheus/client_golang v1.11.0 // indirect
github.com/vektah/gqlparser/v2 v2.1.0
gopkg.in/yaml.v2 v2.4.0 // indirect
)
@@ 6,6 6,15 @@ import (
"git.sr.ht/~sircmpwn/core-go/config"
celery "github.com/gocelery/gocelery"
+ "github.com/prometheus/client_golang/prometheus"
+ "github.com/prometheus/client_golang/prometheus/promauto"
+)
+
+var (
+ buildsSubmitted = promauto.NewCounter(prometheus.CounterOpts{
+ Name: "buildsrht_builds_submited_total",
+ Help: "Number of builds submitted",
+ })
)
func SubmitJob(ctx context.Context, jobID int, manifest *Manifest) error {
@@ 22,6 31,7 @@ func SubmitJob(ctx context.Context, jobID int, manifest *Manifest) error {
}
+ buildsSubmitted.Inc()
_, err = client.Delay("buildsrht.runner.run_build", jobID, manifest)
return err
}