Skip to content

Commit

Permalink
Only append prometheus client to slice when it has a metrics profile (k…
Browse files Browse the repository at this point in the history
…ube-burner#617)

## Type of change

- [ ] Refactor
- [ ] New feature
- [x] Bug fix
- [ ] Optimization
- [ ] Documentation Update

## Description

We were appending a PrometheusClient to the clients slice in all cases
even when that prometheus client was going to be used to scrape alerts,
this clients in this slice are used to scrape metrics and no other
client there should be added.

## Related Tickets & Documents

- Related Issue #
- Closes kube-burner#616

Signed-off-by: Raul Sevilla <[email protected]>
  • Loading branch information
rsevilla87 authored Apr 15, 2024
1 parent 71395d9 commit 469f962
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/util/metrics/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,14 @@ func ProcessMetricsScraperConfig(scraperConfig ScraperConfig) Scraper {
if err != nil {
log.Fatal(err)
}
prometheusClients = append(prometheusClients, p)
}
if metricsEndpoint.AlertProfile != "" {
if alertM, err = alerting.NewAlertManager(metricsEndpoint.AlertProfile, scraperConfig.ConfigSpec.GlobalConfig.UUID, p, metricsEndpoint.EmbedConfig, indexerList...); err != nil {
log.Fatalf("Error creating alert manager: %s", err)
}
alertMs = append(alertMs, alertM)
}
prometheusClients = append(prometheusClients, p)
}
}
return Scraper{
Expand Down

0 comments on commit 469f962

Please sign in to comment.