@@ -160,10 +160,10 @@ func TestPrometheusExporter_WithTLS(t *testing.T) {
160
160
_ = rsp .Body .Close ()
161
161
162
162
want := []string {
163
- `# HELP test_counter_int ` ,
164
- `# TYPE test_counter_int counter` ,
165
- `test_counter_int {code2="one2",foo2="bar2",label_1="label-value-1",resource_attr="resource-attr-val-1"} 123 1581452773000` ,
166
- `test_counter_int {code2="one2",foo2="bar2",label_2="label-value-2",resource_attr="resource-attr-val-1"} 456 1581452773000` ,
163
+ `# HELP test_counter_int_total ` ,
164
+ `# TYPE test_counter_int_total counter` ,
165
+ `test_counter_int_total {code2="one2",foo2="bar2",label_1="label-value-1",resource_attr="resource-attr-val-1"} 123 1581452773000` ,
166
+ `test_counter_int_total {code2="one2",foo2="bar2",label_2="label-value-2",resource_attr="resource-attr-val-1"} 456 1581452773000` ,
167
167
}
168
168
169
169
for _ , w := range want {
@@ -220,18 +220,18 @@ func TestPrometheusExporter_endToEndMultipleTargets(t *testing.T) {
220
220
blob , _ := io .ReadAll (res .Body )
221
221
_ = res .Body .Close ()
222
222
want := []string {
223
- `# HELP test_metric_1_this_one_there_where Extra ones` ,
224
- `# TYPE test_metric_1_this_one_there_where counter` ,
225
- fmt .Sprintf (`test_metric_1_this_one_there_where {arch="x86",code1="one1",foo1="bar1",instance="localhost:8080",job="cpu-exporter",os="windows"} %v` , 99 + 128 ),
226
- fmt .Sprintf (`test_metric_1_this_one_there_where {arch="x86",code1="one1",foo1="bar1",instance="localhost:8080",job="cpu-exporter",os="linux"} %v` , 100 + 128 ),
227
- fmt .Sprintf (`test_metric_1_this_one_there_where {arch="x86",code1="one1",foo1="bar1",instance="localhost:8081",job="cpu-exporter",os="windows"} %v` , 99 + 128 ),
228
- fmt .Sprintf (`test_metric_1_this_one_there_where {arch="x86",code1="one1",foo1="bar1",instance="localhost:8081",job="cpu-exporter",os="linux"} %v` , 100 + 128 ),
229
- `# HELP test_metric_2_this_one_there_where Extra ones` ,
230
- `# TYPE test_metric_2_this_one_there_where counter` ,
231
- fmt .Sprintf (`test_metric_2_this_one_there_where {arch="x86",code1="one1",foo1="bar1",instance="localhost:8080",job="cpu-exporter",os="windows"} %v` , 99 + delta ),
232
- fmt .Sprintf (`test_metric_2_this_one_there_where {arch="x86",code1="one1",foo1="bar1",instance="localhost:8080",job="cpu-exporter",os="linux"} %v` , 100 + delta ),
233
- fmt .Sprintf (`test_metric_2_this_one_there_where {arch="x86",code1="one1",foo1="bar1",instance="localhost:8081",job="cpu-exporter",os="windows"} %v` , 99 + delta ),
234
- fmt .Sprintf (`test_metric_2_this_one_there_where {arch="x86",code1="one1",foo1="bar1",instance="localhost:8081",job="cpu-exporter",os="linux"} %v` , 100 + delta ),
223
+ `# HELP test_metric_1_this_one_there_where_total Extra ones` ,
224
+ `# TYPE test_metric_1_this_one_there_where_total counter` ,
225
+ fmt .Sprintf (`test_metric_1_this_one_there_where_total {arch="x86",code1="one1",foo1="bar1",instance="localhost:8080",job="cpu-exporter",os="windows"} %v` , 99 + 128 ),
226
+ fmt .Sprintf (`test_metric_1_this_one_there_where_total {arch="x86",code1="one1",foo1="bar1",instance="localhost:8080",job="cpu-exporter",os="linux"} %v` , 100 + 128 ),
227
+ fmt .Sprintf (`test_metric_1_this_one_there_where_total {arch="x86",code1="one1",foo1="bar1",instance="localhost:8081",job="cpu-exporter",os="windows"} %v` , 99 + 128 ),
228
+ fmt .Sprintf (`test_metric_1_this_one_there_where_total {arch="x86",code1="one1",foo1="bar1",instance="localhost:8081",job="cpu-exporter",os="linux"} %v` , 100 + 128 ),
229
+ `# HELP test_metric_2_this_one_there_where_total Extra ones` ,
230
+ `# TYPE test_metric_2_this_one_there_where_total counter` ,
231
+ fmt .Sprintf (`test_metric_2_this_one_there_where_total {arch="x86",code1="one1",foo1="bar1",instance="localhost:8080",job="cpu-exporter",os="windows"} %v` , 99 + delta ),
232
+ fmt .Sprintf (`test_metric_2_this_one_there_where_total {arch="x86",code1="one1",foo1="bar1",instance="localhost:8080",job="cpu-exporter",os="linux"} %v` , 100 + delta ),
233
+ fmt .Sprintf (`test_metric_2_this_one_there_where_total {arch="x86",code1="one1",foo1="bar1",instance="localhost:8081",job="cpu-exporter",os="windows"} %v` , 99 + delta ),
234
+ fmt .Sprintf (`test_metric_2_this_one_there_where_total {arch="x86",code1="one1",foo1="bar1",instance="localhost:8081",job="cpu-exporter",os="linux"} %v` , 100 + delta ),
235
235
}
236
236
237
237
for _ , w := range want {
@@ -300,14 +300,14 @@ func TestPrometheusExporter_endToEnd(t *testing.T) {
300
300
blob , _ := io .ReadAll (res .Body )
301
301
_ = res .Body .Close ()
302
302
want := []string {
303
- `# HELP test_metric_1_this_one_there_where Extra ones` ,
304
- `# TYPE test_metric_1_this_one_there_where counter` ,
305
- fmt .Sprintf (`test_metric_1_this_one_there_where {arch="x86",code1="one1",foo1="bar1",instance="localhost:8080",job="cpu-exporter",os="windows"} %v` , 99 + 128 ),
306
- fmt .Sprintf (`test_metric_1_this_one_there_where {arch="x86",code1="one1",foo1="bar1",instance="localhost:8080",job="cpu-exporter",os="linux"} %v` , 100 + 128 ),
307
- `# HELP test_metric_2_this_one_there_where Extra ones` ,
308
- `# TYPE test_metric_2_this_one_there_where counter` ,
309
- fmt .Sprintf (`test_metric_2_this_one_there_where {arch="x86",code1="one1",foo1="bar1",instance="localhost:8080",job="cpu-exporter",os="windows"} %v` , 99 + delta ),
310
- fmt .Sprintf (`test_metric_2_this_one_there_where {arch="x86",code1="one1",foo1="bar1",instance="localhost:8080",job="cpu-exporter",os="linux"} %v` , 100 + delta ),
303
+ `# HELP test_metric_1_this_one_there_where_total Extra ones` ,
304
+ `# TYPE test_metric_1_this_one_there_where_total counter` ,
305
+ fmt .Sprintf (`test_metric_1_this_one_there_where_total {arch="x86",code1="one1",foo1="bar1",instance="localhost:8080",job="cpu-exporter",os="windows"} %v` , 99 + 128 ),
306
+ fmt .Sprintf (`test_metric_1_this_one_there_where_total {arch="x86",code1="one1",foo1="bar1",instance="localhost:8080",job="cpu-exporter",os="linux"} %v` , 100 + 128 ),
307
+ `# HELP test_metric_2_this_one_there_where_total Extra ones` ,
308
+ `# TYPE test_metric_2_this_one_there_where_total counter` ,
309
+ fmt .Sprintf (`test_metric_2_this_one_there_where_total {arch="x86",code1="one1",foo1="bar1",instance="localhost:8080",job="cpu-exporter",os="windows"} %v` , 99 + delta ),
310
+ fmt .Sprintf (`test_metric_2_this_one_there_where_total {arch="x86",code1="one1",foo1="bar1",instance="localhost:8080",job="cpu-exporter",os="linux"} %v` , 100 + delta ),
311
311
}
312
312
313
313
for _ , w := range want {
@@ -377,14 +377,14 @@ func TestPrometheusExporter_endToEndWithTimestamps(t *testing.T) {
377
377
blob , _ := io .ReadAll (res .Body )
378
378
_ = res .Body .Close ()
379
379
want := []string {
380
- `# HELP test_metric_1_this_one_there_where Extra ones` ,
381
- `# TYPE test_metric_1_this_one_there_where counter` ,
382
- fmt .Sprintf (`test_metric_1_this_one_there_where {arch="x86",code2="one2",foo2="bar2",instance="localhost:8080",job="node-exporter",os="windows"} %v %v` , 99 + 128 , 1543160298100 + 128000 ),
383
- fmt .Sprintf (`test_metric_1_this_one_there_where {arch="x86",code2="one2",foo2="bar2",instance="localhost:8080",job="node-exporter",os="linux"} %v %v` , 100 + 128 , 1543160298100 ),
384
- `# HELP test_metric_2_this_one_there_where Extra ones` ,
385
- `# TYPE test_metric_2_this_one_there_where counter` ,
386
- fmt .Sprintf (`test_metric_2_this_one_there_where {arch="x86",code2="one2",foo2="bar2",instance="localhost:8080",job="node-exporter",os="windows"} %v %v` , 99 + delta , 1543160298100 + delta * 1000 ),
387
- fmt .Sprintf (`test_metric_2_this_one_there_where {arch="x86",code2="one2",foo2="bar2",instance="localhost:8080",job="node-exporter",os="linux"} %v %v` , 100 + delta , 1543160298100 ),
380
+ `# HELP test_metric_1_this_one_there_where_total Extra ones` ,
381
+ `# TYPE test_metric_1_this_one_there_where_total counter` ,
382
+ fmt .Sprintf (`test_metric_1_this_one_there_where_total {arch="x86",code2="one2",foo2="bar2",instance="localhost:8080",job="node-exporter",os="windows"} %v %v` , 99 + 128 , 1543160298100 + 128000 ),
383
+ fmt .Sprintf (`test_metric_1_this_one_there_where_total {arch="x86",code2="one2",foo2="bar2",instance="localhost:8080",job="node-exporter",os="linux"} %v %v` , 100 + 128 , 1543160298100 ),
384
+ `# HELP test_metric_2_this_one_there_where_total Extra ones` ,
385
+ `# TYPE test_metric_2_this_one_there_where_total counter` ,
386
+ fmt .Sprintf (`test_metric_2_this_one_there_where_total {arch="x86",code2="one2",foo2="bar2",instance="localhost:8080",job="node-exporter",os="windows"} %v %v` , 99 + delta , 1543160298100 + delta * 1000 ),
387
+ fmt .Sprintf (`test_metric_2_this_one_there_where_total {arch="x86",code2="one2",foo2="bar2",instance="localhost:8080",job="node-exporter",os="linux"} %v %v` , 100 + delta , 1543160298100 ),
388
388
}
389
389
390
390
for _ , w := range want {
@@ -457,10 +457,10 @@ func TestPrometheusExporter_endToEndWithResource(t *testing.T) {
457
457
_ = rsp .Body .Close ()
458
458
459
459
want := []string {
460
- `# HELP test_counter_int ` ,
461
- `# TYPE test_counter_int counter` ,
462
- `test_counter_int {code2="one2",foo2="bar2",label_1="label-value-1",resource_attr="resource-attr-val-1"} 123 1581452773000` ,
463
- `test_counter_int {code2="one2",foo2="bar2",label_2="label-value-2",resource_attr="resource-attr-val-1"} 456 1581452773000` ,
460
+ `# HELP test_counter_int_total ` ,
461
+ `# TYPE test_counter_int_total counter` ,
462
+ `test_counter_int_total {code2="one2",foo2="bar2",label_1="label-value-1",resource_attr="resource-attr-val-1"} 123 1581452773000` ,
463
+ `test_counter_int_total {code2="one2",foo2="bar2",label_2="label-value-2",resource_attr="resource-attr-val-1"} 456 1581452773000` ,
464
464
}
465
465
466
466
for _ , w := range want {
0 commit comments