Skip to content

Commit

Permalink
Add a branch label to workflow metrics
Browse files Browse the repository at this point in the history
Signed-off-by: Rauf Guliyev <rguliyev@yugabyte.com>
  • Loading branch information
rguliyev committed Feb 2, 2024
1 parent d2d9692 commit 234cf8b
Show file tree
Hide file tree
Showing 11 changed files with 94 additions and 76 deletions.
5 changes: 1 addition & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,17 @@ go 1.20
require (
github.com/alecthomas/kingpin/v2 v2.4.0
github.com/go-kit/log v0.2.1
github.com/google/go-github/v50 v50.2.0
github.com/google/go-github/v58 v58.0.0
github.com/prometheus/client_golang v1.18.0
github.com/prometheus/common v0.46.0
github.com/stretchr/testify v1.8.4
golang.org/x/oauth2 v0.16.0
)

require (
github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8 // indirect
github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/cloudflare/circl v1.1.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/go-logfmt/logfmt v0.6.0 // indirect
github.com/golang/protobuf v1.5.3 // indirect
Expand All @@ -27,7 +25,6 @@ require (
github.com/prometheus/client_model v0.5.0 // indirect
github.com/prometheus/procfs v0.12.0 // indirect
github.com/xhit/go-str2duration/v2 v2.1.0 // indirect
golang.org/x/crypto v0.18.0 // indirect
golang.org/x/net v0.20.0 // indirect
golang.org/x/sys v0.16.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
Expand Down
20 changes: 3 additions & 17 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8 h1:wPbRQzjjwFc0ih8puEVAOFGELsn1zoIIYdxvML7mDxA=
github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8/go.mod h1:I0gYDMZ6Z5GRU7l58bNFSkPTFN6Yl12dsUlAZ8xy98g=
github.com/alecthomas/kingpin/v2 v2.4.0 h1:f48lwail6p8zpO1bC4TxtqACaGqHYA22qkHjHpqDjYY=
github.com/alecthomas/kingpin/v2 v2.4.0/go.mod h1:0gyi0zQnjuFk8xrkNKamJoyUo382HRL7ATRpFZCw6tE=
github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 h1:s6gZFSlWYmbqAuRjVTiNNhvNRfY2Wxp9nhfyel4rklc=
github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137/go.mod h1:OMCwj8VM1Kc9e19TLln2VL61YJF0x1XFtfdL4JdbSyE=
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
github.com/bwesterb/go-ristretto v1.2.0/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0=
github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44=
github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/cloudflare/circl v1.1.0 h1:bZgT/A+cikZnKIwn7xL2OBj012Bmvho/o6RpRvv3GKY=
github.com/cloudflare/circl v1.1.0/go.mod h1:prBCrKB9DV4poKZY1l9zBXg2QJY7mvgRvtMxxK7fi4I=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
Expand All @@ -25,9 +20,9 @@ github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg
github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
github.com/google/go-github/v50 v50.2.0 h1:j2FyongEHlO9nxXLc+LP3wuBSVU9mVxfpdYUexMpIfk=
github.com/google/go-github/v50 v50.2.0/go.mod h1:VBY8FB6yPIjrtKhozXv4FQupxKLS6H4m6xFZlT43q8Q=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-github/v58 v58.0.0 h1:Una7GGERlF/37XfkPwpzYJe0Vp4dt2k1kCjlxwjIvzw=
github.com/google/go-github/v58 v58.0.0/go.mod h1:k4hxDKEfoWpSqFlc8LTpGd9fu2KrV1YAa6Hi6FmDNY4=
github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8=
github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
Expand All @@ -51,25 +46,16 @@ github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXl
github.com/xhit/go-str2duration/v2 v2.1.0 h1:lxklc02Drh6ynqX+DdPyp5pCKLUQpRT8bp8Ydu2Bstc=
github.com/xhit/go-str2duration/v2 v2.1.0/go.mod h1:ohY8p+0f07DiV6Em5LKB0s2YpLtXVyJfNt1+BlmyAsU=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.18.0 h1:PGVlW0xEltQnzFZ55hkuX5+KLyrMYhHld1YHO4AKcdc=
golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg=
golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo=
golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY=
golang.org/x/oauth2 v0.16.0 h1:aDkGMBSYxElaoP81NpoUoz2oo2R2wHdZpGToUxfyQrQ=
golang.org/x/oauth2 v0.16.0/go.mod h1:hqZ+0LWXsiVoZpeld6jVt06P3adbS2Uu911W1SsJv2o=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU=
golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c=
Expand Down
2 changes: 1 addition & 1 deletion internal/server/billing_metrics_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

"github.com/go-kit/log"
"github.com/go-kit/log/level"
"github.com/google/go-github/v50/github"
"github.com/google/go-github/v58/github"
"golang.org/x/oauth2"
)

Expand Down
40 changes: 20 additions & 20 deletions internal/server/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,36 +8,36 @@ var (
Help: "Time that a workflow job took to reach a given state.",
Buckets: prometheus.ExponentialBuckets(1, 1.4, 30),
},
[]string{"org", "repo", "state", "runner_group"},
[]string{"org", "repo", "branch", "state", "runner_group"},
)

workflowJobDurationCounter = prometheus.NewCounterVec(prometheus.CounterOpts{
Name: "workflow_job_duration_seconds_total",
Help: "The total duration of jobs.",
},
[]string{"org", "repo", "status", "conclusion", "runner_group"},
[]string{"org", "repo", "branch", "status", "conclusion", "runner_group"},
)

workflowJobStatusCounter = prometheus.NewCounterVec(prometheus.CounterOpts{
Name: "workflow_job_status_count",
Help: "Count of workflow job events.",
},
[]string{"org", "repo", "status", "conclusion", "runner_group"},
[]string{"org", "repo", "branch", "status", "conclusion", "runner_group"},
)

workflowRunHistogramVec = prometheus.NewHistogramVec(prometheus.HistogramOpts{
Name: "workflow_execution_time_seconds",
Help: "Time that a workflow took to run.",
Buckets: prometheus.ExponentialBuckets(1, 1.4, 30),
},
[]string{"org", "repo", "workflow_name", "conclusion"},
[]string{"org", "repo", "branch", "workflow_name", "conclusion"},
)

workflowRunStatusCounter = prometheus.NewCounterVec(prometheus.CounterOpts{
Name: "workflow_status_count",
Help: "Count of the occurrences of different workflow states.",
},
[]string{"org", "repo", "status", "conclusion", "workflow_name"},
[]string{"org", "repo", "branch", "status", "conclusion", "workflow_name"},
)

totalMinutesUsedActions = prometheus.NewGaugeVec(prometheus.GaugeOpts{
Expand Down Expand Up @@ -107,35 +107,35 @@ func init() {
}

type WorkflowObserver interface {
ObserveWorkflowJobDuration(org, repo, state, runnerGroup string, seconds float64)
CountWorkflowJobStatus(org, repo, status, conclusion, runnerGroup string)
CountWorkflowJobDuration(org, repo, status, conclusion, runnerGroup string, seconds float64)
ObserveWorkflowRunDuration(org, repo, workflow, conclusion string, seconds float64)
CountWorkflowRunStatus(org, repo, status, conclusion, workflow string)
ObserveWorkflowJobDuration(org, repo, branch, state, runnerGroup string, seconds float64)
CountWorkflowJobStatus(org, repo, branch, status, conclusion, runnerGroup string)
CountWorkflowJobDuration(org, repo, branch, status, conclusion, runnerGroup string, seconds float64)
ObserveWorkflowRunDuration(org, repo, branch, workflow, conclusion string, seconds float64)
CountWorkflowRunStatus(org, repo, branch, status, conclusion, workflow string)
}

var _ WorkflowObserver = (*PrometheusObserver)(nil)

type PrometheusObserver struct{}

func (o *PrometheusObserver) ObserveWorkflowJobDuration(org, repo, state, runnerGroup string, seconds float64) {
workflowJobHistogramVec.WithLabelValues(org, repo, state, runnerGroup).
func (o *PrometheusObserver) ObserveWorkflowJobDuration(org, repo, branch, state, runnerGroup string, seconds float64) {
workflowJobHistogramVec.WithLabelValues(org, repo, branch, state, runnerGroup).
Observe(seconds)
}

func (o *PrometheusObserver) CountWorkflowJobStatus(org, repo, status, conclusion, runnerGroup string) {
workflowJobStatusCounter.WithLabelValues(org, repo, status, conclusion, runnerGroup).Inc()
func (o *PrometheusObserver) CountWorkflowJobStatus(org, repo, branch, status, conclusion, runnerGroup string) {
workflowJobStatusCounter.WithLabelValues(org, repo, branch, status, conclusion, runnerGroup).Inc()
}

func (o *PrometheusObserver) CountWorkflowJobDuration(org, repo, status, conclusion, runnerGroup string, seconds float64) {
workflowJobDurationCounter.WithLabelValues(org, repo, status, conclusion, runnerGroup).Add(seconds)
func (o *PrometheusObserver) CountWorkflowJobDuration(org, repo, branch, status, conclusion, runnerGroup string, seconds float64) {
workflowJobDurationCounter.WithLabelValues(org, repo, branch, status, conclusion, runnerGroup).Add(seconds)
}

func (o *PrometheusObserver) ObserveWorkflowRunDuration(org, repo, workflowName, conclusion string, seconds float64) {
workflowRunHistogramVec.WithLabelValues(org, repo, workflowName, conclusion).
func (o *PrometheusObserver) ObserveWorkflowRunDuration(org, repo, branch, workflowName, conclusion string, seconds float64) {
workflowRunHistogramVec.WithLabelValues(org, repo, branch, workflowName, conclusion).
Observe(seconds)
}

func (o *PrometheusObserver) CountWorkflowRunStatus(org, repo, status, conclusion, workflowName string) {
workflowRunStatusCounter.WithLabelValues(org, repo, status, conclusion, workflowName).Inc()
func (o *PrometheusObserver) CountWorkflowRunStatus(org, repo, branch, status, conclusion, workflowName string) {
workflowRunStatusCounter.WithLabelValues(org, repo, branch, status, conclusion, workflowName).Inc()
}
8 changes: 5 additions & 3 deletions internal/server/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

"github.com/cpanato/github_actions_exporter/internal/server"
"github.com/go-kit/log"
"github.com/google/go-github/v50/github"
"github.com/google/go-github/v58/github"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
Expand Down Expand Up @@ -87,6 +87,7 @@ func Test_Server_MetricsRouteAfterWorkflowJob(t *testing.T) {
}()

repo := "some-repo"
branch := "some-branch"
org := "someone"
expectedDuration := 10.0
jobStartedAt := time.Unix(1650308740, 0)
Expand All @@ -102,6 +103,7 @@ func Test_Server_MetricsRouteAfterWorkflowJob(t *testing.T) {
},
},
WorkflowJob: &github.WorkflowJob{
HeadBranch: &branch,
Status: github.String("completed"),
Conclusion: github.String("success"),
StartedAt: &github.Timestamp{Time: jobStartedAt},
Expand All @@ -125,6 +127,6 @@ func Test_Server_MetricsRouteAfterWorkflowJob(t *testing.T) {

payload, err := io.ReadAll(metricsRes.Body)
require.NoError(t, err)
assert.Contains(t, string(payload), `workflow_job_duration_seconds_bucket{org="someone",repo="some-repo",runner_group="runner-group",state="in_progress",le="10.541350399999995"} 1`)
assert.Contains(t, string(payload), `workflow_job_duration_seconds_total{conclusion="success",org="someone",repo="some-repo",runner_group="runner-group",status="completed"} 10`)
assert.Contains(t, string(payload), `workflow_job_duration_seconds_bucket{branch="some-branch",org="someone",repo="some-repo",runner_group="runner-group",state="in_progress",le="10.541350399999995"} 1`)
assert.Contains(t, string(payload), `workflow_job_duration_seconds_total{branch="some-branch",conclusion="success",org="someone",repo="some-repo",runner_group="runner-group",status="completed"} 10`)
}
20 changes: 11 additions & 9 deletions internal/server/workflow_metrics_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
"github.com/cpanato/github_actions_exporter/model"
"github.com/go-kit/log"
"github.com/go-kit/log/level"
"github.com/google/go-github/v50/github"
"github.com/google/go-github/v58/github"
)

// WorkflowMetricsExporter struct to hold some information
Expand Down Expand Up @@ -74,11 +74,11 @@ func (c *WorkflowMetricsExporter) HandleGHWebHook(w http.ResponseWriter, r *http
return
case "workflow_job":
event := model.WorkflowJobEventFromJSON(io.NopCloser(bytes.NewBuffer(buf)))
_ = level.Info(c.Logger).Log("msg", "got workflow_job event", "org", event.GetRepo().GetOwner().GetLogin(), "repo", event.GetRepo().GetName(), "runId", event.GetWorkflowJob().GetRunID(), "action", event.GetAction())
_ = level.Info(c.Logger).Log("msg", "got workflow_job event", "org", event.GetRepo().GetOwner().GetLogin(), "repo", event.GetRepo().GetName(), "branch", event.GetWorkflowJob().GetHeadBranch(), "runId", event.GetWorkflowJob().GetRunID(), "action", event.GetAction())
go c.CollectWorkflowJobEvent(event)
case "workflow_run":
event := model.WorkflowRunEventFromJSON(io.NopCloser(bytes.NewBuffer(buf)))
_ = level.Info(c.Logger).Log("msg", "got workflow_run event", "org", event.GetRepo().GetOwner().GetLogin(), "repo", event.GetRepo().GetName(), "workflow_name", event.GetWorkflow().GetName(), "runNumber", event.GetWorkflowRun().GetRunNumber(), "action", event.GetAction())
_ = level.Info(c.Logger).Log("msg", "got workflow_run event", "org", event.GetRepo().GetOwner().GetLogin(), "repo", event.GetRepo().GetName(), "branch", event.GetWorkflowRun().GetHeadBranch(), "workflow_name", event.GetWorkflow().GetName(), "runNumber", event.GetWorkflowRun().GetRunNumber(), "action", event.GetAction())
go c.CollectWorkflowRunEvent(event)
default:
_ = level.Info(c.Logger).Log("msg", "not implemented", "eventType", eventType)
Expand All @@ -93,6 +93,7 @@ func (c *WorkflowMetricsExporter) HandleGHWebHook(w http.ResponseWriter, r *http
func (c *WorkflowMetricsExporter) CollectWorkflowJobEvent(event *github.WorkflowJobEvent) {
repo := event.GetRepo().GetName()
org := event.GetRepo().GetOwner().GetLogin()
branch := event.WorkflowJob.GetHeadBranch()
runnerGroup := event.WorkflowJob.GetRunnerGroupName()

action := event.GetAction()
Expand All @@ -111,34 +112,35 @@ func (c *WorkflowMetricsExporter) CollectWorkflowJobEvent(event *github.Workflow

firstStep := event.WorkflowJob.Steps[0]
queuedSeconds := firstStep.StartedAt.Time.Sub(event.WorkflowJob.StartedAt.Time).Seconds()
c.PrometheusObserver.ObserveWorkflowJobDuration(org, repo, "queued", runnerGroup, math.Max(0, queuedSeconds))
c.PrometheusObserver.ObserveWorkflowJobDuration(org, repo, branch, "queued", runnerGroup, math.Max(0, queuedSeconds))
case "completed":
if event.WorkflowJob.StartedAt == nil || event.WorkflowJob.CompletedAt == nil {
_ = level.Debug(c.Logger).Log("msg", "unable to calculate job duration of completed event steps are missing timestamps")
break
}

jobSeconds := math.Max(0, event.WorkflowJob.GetCompletedAt().Time.Sub(event.WorkflowJob.GetStartedAt().Time).Seconds())
c.PrometheusObserver.ObserveWorkflowJobDuration(org, repo, "in_progress", runnerGroup, jobSeconds)
c.PrometheusObserver.CountWorkflowJobDuration(org, repo, status, conclusion, runnerGroup, jobSeconds)
c.PrometheusObserver.ObserveWorkflowJobDuration(org, repo, branch, "in_progress", runnerGroup, jobSeconds)
c.PrometheusObserver.CountWorkflowJobDuration(org, repo, branch, status, conclusion, runnerGroup, jobSeconds)
}

c.PrometheusObserver.CountWorkflowJobStatus(org, repo, status, conclusion, runnerGroup)
c.PrometheusObserver.CountWorkflowJobStatus(org, repo, branch, status, conclusion, runnerGroup)
}

func (c *WorkflowMetricsExporter) CollectWorkflowRunEvent(event *github.WorkflowRunEvent) {
repo := event.GetRepo().GetName()
org := event.GetRepo().GetOwner().GetLogin()
branch := event.GetWorkflowRun().GetHeadBranch()
workflowName := event.GetWorkflow().GetName()
conclusion := event.GetWorkflowRun().GetConclusion()

if event.GetAction() == "completed" {
seconds := event.GetWorkflowRun().UpdatedAt.Time.Sub(event.GetWorkflowRun().RunStartedAt.Time).Seconds()
c.PrometheusObserver.ObserveWorkflowRunDuration(org, repo, workflowName, conclusion, seconds)
c.PrometheusObserver.ObserveWorkflowRunDuration(org, repo, branch, workflowName, conclusion, seconds)
}

status := event.GetWorkflowRun().GetStatus()
c.PrometheusObserver.CountWorkflowRunStatus(org, repo, status, conclusion, workflowName)
c.PrometheusObserver.CountWorkflowRunStatus(org, repo, branch, status, conclusion, workflowName)
}

// validateSignature validate the incoming github event.
Expand Down
Loading

0 comments on commit 234cf8b

Please sign in to comment.