Skip to content

Commit

Permalink
Add account to labels on logpush events, bump golangci
Browse files Browse the repository at this point in the history
  • Loading branch information
haad committed May 8, 2024
1 parent 3717ea1 commit 0a1f4f0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ jobs:
- name: golangci-lint
uses: golangci/golangci-lint-action@v6 # https://github.com/marketplace/actions/run-golangci-lint
with:
version: v1.43
version: v1.58.0
8 changes: 4 additions & 4 deletions prometheus.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ var (
Name: logpushFailedJobsAccountMetricName.String(),
Help: "Number of failed logpush jobs on the account level",
},
[]string{"destination", "job_id", "final"},
[]string{"account", "destination", "job_id", "final"},
)

logpushFailedJobsZone = prometheus.NewCounterVec(prometheus.CounterOpts{
Expand Down Expand Up @@ -453,9 +453,9 @@ func fetchLogpushAnalyticsForAccount(account cloudflare.Account, wg *sync.WaitGr
return
}

for _, account := range r.Viewer.Accounts {
for _, LogpushHealthAdaptiveGroup := range account.LogpushHealthAdaptiveGroups {
logpushFailedJobsAccount.With(prometheus.Labels{"destination": LogpushHealthAdaptiveGroup.Dimensions.DestinationType, "job_id": strconv.Itoa(LogpushHealthAdaptiveGroup.Dimensions.JobId), "final": strconv.Itoa(LogpushHealthAdaptiveGroup.Dimensions.Final)}).Add(float64(LogpushHealthAdaptiveGroup.Count))
for _, acc := range r.Viewer.Accounts {
for _, LogpushHealthAdaptiveGroup := range acc.LogpushHealthAdaptiveGroups {
logpushFailedJobsAccount.With(prometheus.Labels{"account": account.ID, "destination": LogpushHealthAdaptiveGroup.Dimensions.DestinationType, "job_id": strconv.Itoa(LogpushHealthAdaptiveGroup.Dimensions.JobId), "final": strconv.Itoa(LogpushHealthAdaptiveGroup.Dimensions.Final)}).Add(float64(LogpushHealthAdaptiveGroup.Count))
}
}

Expand Down

0 comments on commit 0a1f4f0

Please sign in to comment.