@@ -92,7 +92,7 @@ func testHandler(t testing.TB) {
92
92
},
93
93
}
94
94
externalBuf := & bytes.Buffer {}
95
- enc := expfmt .NewEncoder (externalBuf , expfmt .FmtProtoDelim )
95
+ enc := expfmt .NewEncoder (externalBuf , expfmt .NewFormat ( expfmt . TypeProtoDelim ) )
96
96
if err := enc .Encode (externalMetricFamily ); err != nil {
97
97
t .Fatal (err )
98
98
}
@@ -162,7 +162,7 @@ metric: <
162
162
},
163
163
}
164
164
buf := & bytes.Buffer {}
165
- enc = expfmt .NewEncoder (buf , expfmt .FmtProtoDelim )
165
+ enc = expfmt .NewEncoder (buf , expfmt .NewFormat ( expfmt . TypeProtoDelim ) )
166
166
if err := enc .Encode (expectedMetricFamily ); err != nil {
167
167
t .Fatal (err )
168
168
}
@@ -361,7 +361,7 @@ collected metric "broken_metric" { label:<name:"foo" value:"bar" > label:<name:"
361
361
},
362
362
out : output {
363
363
headers : map [string ]string {
364
- "Content-Type" : `text/plain; version=0.0.4; charset=utf-8` ,
364
+ "Content-Type" : `text/plain; version=0.0.4; charset=utf-8; escaping=values ` ,
365
365
},
366
366
body : []byte {},
367
367
},
@@ -372,7 +372,7 @@ collected metric "broken_metric" { label:<name:"foo" value:"bar" > label:<name:"
372
372
},
373
373
out : output {
374
374
headers : map [string ]string {
375
- "Content-Type" : `text/plain; version=0.0.4; charset=utf-8` ,
375
+ "Content-Type" : `text/plain; version=0.0.4; charset=utf-8; escaping=values ` ,
376
376
},
377
377
body : []byte {},
378
378
},
@@ -383,7 +383,7 @@ collected metric "broken_metric" { label:<name:"foo" value:"bar" > label:<name:"
383
383
},
384
384
out : output {
385
385
headers : map [string ]string {
386
- "Content-Type" : `text/plain; version=0.0.4; charset=utf-8` ,
386
+ "Content-Type" : `text/plain; version=0.0.4; charset=utf-8; escaping=values ` ,
387
387
},
388
388
body : []byte {},
389
389
},
@@ -394,7 +394,7 @@ collected metric "broken_metric" { label:<name:"foo" value:"bar" > label:<name:"
394
394
},
395
395
out : output {
396
396
headers : map [string ]string {
397
- "Content-Type" : `application/vnd.google.protobuf; proto=io.prometheus.client.MetricFamily; encoding=delimited` ,
397
+ "Content-Type" : `application/vnd.google.protobuf; proto=io.prometheus.client.MetricFamily; encoding=delimited; escaping=values ` ,
398
398
},
399
399
body : []byte {},
400
400
},
@@ -405,7 +405,7 @@ collected metric "broken_metric" { label:<name:"foo" value:"bar" > label:<name:"
405
405
},
406
406
out : output {
407
407
headers : map [string ]string {
408
- "Content-Type" : `text/plain; version=0.0.4; charset=utf-8` ,
408
+ "Content-Type" : `text/plain; version=0.0.4; charset=utf-8; escaping=values ` ,
409
409
},
410
410
body : expectedMetricFamilyAsText ,
411
411
},
@@ -417,7 +417,7 @@ collected metric "broken_metric" { label:<name:"foo" value:"bar" > label:<name:"
417
417
},
418
418
out : output {
419
419
headers : map [string ]string {
420
- "Content-Type" : `application/vnd.google.protobuf; proto=io.prometheus.client.MetricFamily; encoding=delimited` ,
420
+ "Content-Type" : `application/vnd.google.protobuf; proto=io.prometheus.client.MetricFamily; encoding=delimited; escaping=values ` ,
421
421
},
422
422
body : expectedMetricFamilyAsBytes ,
423
423
},
@@ -429,7 +429,7 @@ collected metric "broken_metric" { label:<name:"foo" value:"bar" > label:<name:"
429
429
},
430
430
out : output {
431
431
headers : map [string ]string {
432
- "Content-Type" : `text/plain; version=0.0.4; charset=utf-8` ,
432
+ "Content-Type" : `text/plain; version=0.0.4; charset=utf-8; escaping=values ` ,
433
433
},
434
434
body : externalMetricFamilyAsText ,
435
435
},
@@ -441,7 +441,7 @@ collected metric "broken_metric" { label:<name:"foo" value:"bar" > label:<name:"
441
441
},
442
442
out : output {
443
443
headers : map [string ]string {
444
- "Content-Type" : `application/vnd.google.protobuf; proto=io.prometheus.client.MetricFamily; encoding=delimited` ,
444
+ "Content-Type" : `application/vnd.google.protobuf; proto=io.prometheus.client.MetricFamily; encoding=delimited; escaping=values ` ,
445
445
},
446
446
body : externalMetricFamilyAsBytes ,
447
447
},
@@ -453,7 +453,7 @@ collected metric "broken_metric" { label:<name:"foo" value:"bar" > label:<name:"
453
453
},
454
454
out : output {
455
455
headers : map [string ]string {
456
- "Content-Type" : `application/vnd.google.protobuf; proto=io.prometheus.client.MetricFamily; encoding=delimited` ,
456
+ "Content-Type" : `application/vnd.google.protobuf; proto=io.prometheus.client.MetricFamily; encoding=delimited; escaping=values ` ,
457
457
},
458
458
body : bytes .Join (
459
459
[][]byte {
@@ -472,7 +472,7 @@ collected metric "broken_metric" { label:<name:"foo" value:"bar" > label:<name:"
472
472
},
473
473
out : output {
474
474
headers : map [string ]string {
475
- "Content-Type" : `text/plain; version=0.0.4; charset=utf-8` ,
475
+ "Content-Type" : `text/plain; version=0.0.4; charset=utf-8; escaping=values ` ,
476
476
},
477
477
body : []byte {},
478
478
},
@@ -483,7 +483,7 @@ collected metric "broken_metric" { label:<name:"foo" value:"bar" > label:<name:"
483
483
},
484
484
out : output {
485
485
headers : map [string ]string {
486
- "Content-Type" : `text/plain; version=0.0.4; charset=utf-8` ,
486
+ "Content-Type" : `text/plain; version=0.0.4; charset=utf-8; escaping=values ` ,
487
487
},
488
488
body : expectedMetricFamilyAsText ,
489
489
},
@@ -495,7 +495,7 @@ collected metric "broken_metric" { label:<name:"foo" value:"bar" > label:<name:"
495
495
},
496
496
out : output {
497
497
headers : map [string ]string {
498
- "Content-Type" : `text/plain; version=0.0.4; charset=utf-8` ,
498
+ "Content-Type" : `text/plain; version=0.0.4; charset=utf-8; escaping=values ` ,
499
499
},
500
500
body : bytes .Join (
501
501
[][]byte {
@@ -514,7 +514,7 @@ collected metric "broken_metric" { label:<name:"foo" value:"bar" > label:<name:"
514
514
},
515
515
out : output {
516
516
headers : map [string ]string {
517
- "Content-Type" : `application/vnd.google.protobuf; proto=io.prometheus.client.MetricFamily; encoding=delimited` ,
517
+ "Content-Type" : `application/vnd.google.protobuf; proto=io.prometheus.client.MetricFamily; encoding=delimited; escaping=values ` ,
518
518
},
519
519
body : bytes .Join (
520
520
[][]byte {
@@ -533,7 +533,7 @@ collected metric "broken_metric" { label:<name:"foo" value:"bar" > label:<name:"
533
533
},
534
534
out : output {
535
535
headers : map [string ]string {
536
- "Content-Type" : `application/vnd.google.protobuf; proto=io.prometheus.client.MetricFamily; encoding=text` ,
536
+ "Content-Type" : `application/vnd.google.protobuf; proto=io.prometheus.client.MetricFamily; encoding=text; escaping=values ` ,
537
537
},
538
538
body : bytes .Join (
539
539
[][]byte {
@@ -552,7 +552,7 @@ collected metric "broken_metric" { label:<name:"foo" value:"bar" > label:<name:"
552
552
},
553
553
out : output {
554
554
headers : map [string ]string {
555
- "Content-Type" : `application/vnd.google.protobuf; proto=io.prometheus.client.MetricFamily; encoding=compact-text` ,
555
+ "Content-Type" : `application/vnd.google.protobuf; proto=io.prometheus.client.MetricFamily; encoding=compact-text; escaping=values ` ,
556
556
},
557
557
body : bytes .Join (
558
558
[][]byte {
@@ -571,7 +571,7 @@ collected metric "broken_metric" { label:<name:"foo" value:"bar" > label:<name:"
571
571
},
572
572
out : output {
573
573
headers : map [string ]string {
574
- "Content-Type" : `application/vnd.google.protobuf; proto=io.prometheus.client.MetricFamily; encoding=compact-text` ,
574
+ "Content-Type" : `application/vnd.google.protobuf; proto=io.prometheus.client.MetricFamily; encoding=compact-text; escaping=values ` ,
575
575
},
576
576
body : bytes .Join (
577
577
[][]byte {
@@ -609,7 +609,7 @@ collected metric "broken_metric" { label:<name:"foo" value:"bar" > label:<name:"
609
609
},
610
610
out : output {
611
611
headers : map [string ]string {
612
- "Content-Type" : `text/plain; version=0.0.4; charset=utf-8` ,
612
+ "Content-Type" : `text/plain; version=0.0.4; charset=utf-8; escaping=values ` ,
613
613
},
614
614
body : expectedMetricFamilyAsText ,
615
615
},
@@ -666,7 +666,7 @@ collected metric "broken_metric" { label:<name:"foo" value:"bar" > label:<name:"
666
666
},
667
667
out : output {
668
668
headers : map [string ]string {
669
- "Content-Type" : `text/plain; version=0.0.4; charset=utf-8` ,
669
+ "Content-Type" : `text/plain; version=0.0.4; charset=utf-8; escaping=values ` ,
670
670
},
671
671
body : bytes .Join (
672
672
[][]byte {
0 commit comments