lib/streamaggr: use multiple job labels in BenchmarkAggregatorsPush

This commit is contained in:
Aliaksandr Valialkin 2024-03-04 17:37:04 +02:00
parent b530f6bf73
commit 9773ad200e
No known key found for this signature in database
GPG key ID: 52C003EE2BCDB9EB

View file

@ -97,8 +97,8 @@ func newBenchAggregators(output string, pushFunc PushFunc) *Aggregators {
func newBenchSeries(seriesCount int) []prompbmarshal.TimeSeries {
a := make([]string, seriesCount)
for j := 0; j < seriesCount; j++ {
s := fmt.Sprintf(`http_requests_total{path="/foo/%d",job="foo",instance="bar",pod="pod-123232312",namespace="kube-foo-bar",node="node-123-3434-443",`+
`some_other_label="foo-bar-baz",environment="prod",label1="value1",label2="value2",label3="value3"} %d`, j, j*1000)
s := fmt.Sprintf(`http_requests_total{path="/foo/%d",job="foo_%d",instance="bar",pod="pod-123232312",namespace="kube-foo-bar",node="node-123-3434-443",`+
`some_other_label="foo-bar-baz",environment="prod",label1="value1",label2="value2",label3="value3"} %d`, j, j%100, j*1000)
a = append(a, s)
}
metrics := strings.Join(a, "\n")