diff --git a/pkg/metrics/get_billable_from_github.go b/pkg/metrics/get_billable_from_github.go index 23f2fc8..744fada 100644 --- a/pkg/metrics/get_billable_from_github.go +++ b/pkg/metrics/get_billable_from_github.go @@ -26,6 +26,8 @@ var ( // getBillableFromGithub - return billable informations for MACOS, WINDOWS and UBUNTU runners. func getBillableFromGithub() { for { + workflowBillGauge.Reset() + for _, repo := range repositories { for k, v := range workflows[repo] { r := strings.Split(repo, "/") diff --git a/pkg/metrics/get_runners_from_github.go b/pkg/metrics/get_runners_from_github.go index f0b2260..bc5ab45 100644 --- a/pkg/metrics/get_runners_from_github.go +++ b/pkg/metrics/get_runners_from_github.go @@ -51,6 +51,8 @@ func getAllRepoRunners(owner string, repo string) []*github.Runner { // getRunnersFromGithub - return information about runners and their status for a specific repo func getRunnersFromGithub() { for { + runnersGauge.Reset() + for _, repo := range repositories { r := strings.Split(repo, "/") diff --git a/pkg/metrics/get_workflow_runs_from_github.go b/pkg/metrics/get_workflow_runs_from_github.go index 4e376f1..e47c4d0 100644 --- a/pkg/metrics/get_workflow_runs_from_github.go +++ b/pkg/metrics/get_workflow_runs_from_github.go @@ -106,6 +106,9 @@ func getRunUsage(owner string, repo string, runId int64) *github.WorkflowRunUsag // getWorkflowRunsFromGithub - return informations and status about a workflow func getWorkflowRunsFromGithub() { for { + workflowRunStatusGauge.Reset() + workflowRunDurationGauge.Reset() + for _, repo := range repositories { r := strings.Split(repo, "/") runs := getRecentWorkflowRuns(r[0], r[1]) diff --git a/pkg/server/server.go b/pkg/server/server.go index c99a0be..3989d48 100644 --- a/pkg/server/server.go +++ b/pkg/server/server.go @@ -2,6 +2,7 @@ package server import ( "log" + "net" "strconv" "github.com/fasthttp/router" @@ -30,6 +31,7 @@ func RunServer(ctx *cli.Context) error { r.GET("/debug/pprof/{profile}", pprofHandlerIndex) } - log.Print("exporter listening on 0.0.0.0:" + strconv.Itoa(config.Port)) - return fasthttp.ListenAndServe(":"+strconv.Itoa(config.Port), r.Handler) + log.Print("exporter listening on 0.0.0.0::" + strconv.Itoa(config.Port)) + ln, _ := net.Listen("tcp", ":"+strconv.Itoa(config.Port)) + return fasthttp.Serve(ln, r.Handler) }