Skip to content

Commit

Permalink
Really fix lint issue
Browse files Browse the repository at this point in the history
  • Loading branch information
mcorbin committed Dec 8, 2022
1 parent dbabb7f commit 716029b
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions healthcheck/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,15 @@ func (c *Component) startWrapper(w *Wrapper) {
histoLabels := map[string]string{
"name": w.healthcheck.Base().Name,
}
for _, k := range c.healthchecksLabels { //nolint
for _, k := range c.healthchecksLabels {
histoLabels[k] = result.Labels[k]
}
c.resultHistogram.With(prom.Labels(histoLabels)).Observe(duration.Seconds())
counterLabels := map[string]string{
"name": w.healthcheck.Base().Name,
"status": status,
}
for _, k := range c.healthchecksLabels { //nolint
for _, k := range c.healthchecksLabels {
counterLabels[k] = result.Labels[k]
}
c.resultCounter.With(prom.Labels(counterLabels)).Inc()
Expand All @@ -96,9 +96,7 @@ func New(logger *zap.Logger, chanResult chan *Result, promComponent *prometheus.
0.005, 0.01, 0.025, 0.05, 0.1, 0.25, 0.5, 0.75, 1,
2.5, 5, 7.5, 10}
histoLabels := []string{"name"}
for _, k := range healthchecksLabels {
histoLabels = append(histoLabels, k)
}
histoLabels = append(histoLabels, healthchecksLabels...)
histo := prom.NewHistogramVec(prom.HistogramOpts{
Name: "healthcheck_duration_seconds",
Help: "Time to execute a healthcheck.",
Expand All @@ -107,9 +105,7 @@ func New(logger *zap.Logger, chanResult chan *Result, promComponent *prometheus.
histoLabels,
)
counterLabels := []string{"name", "status"}
for _, k := range healthchecksLabels {
counterLabels = append(counterLabels, k)
}
counterLabels = append(counterLabels, healthchecksLabels...)
counter := prom.NewCounterVec(
prom.CounterOpts{
Name: "healthcheck_total",
Expand Down

0 comments on commit 716029b

Please sign in to comment.