Skip to content

Commit

Permalink
feat: use string buidler
Browse files Browse the repository at this point in the history
Signed-off-by: Smuu <[email protected]>
  • Loading branch information
smuu committed Dec 9, 2024
1 parent 47e7e9d commit b5d3219
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test/e2e/prometheus/prometheus.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,14 +180,16 @@ global:
scrape_configs:
`, defaultScrapeInterval.String())

var builder strings.Builder
for _, j := range p.scrapeJobs {
conf += fmt.Sprintf(`
builder.WriteString(fmt.Sprintf(`
- job_name: %s
scrape_interval: %s
static_configs:
- targets: [%s]
`, j.Name, j.Interval.String(), j.Target)
`, j.Name, j.Interval.String(), j.Target))
}
conf += builder.String()

return conf
}

0 comments on commit b5d3219

Please sign in to comment.