@@ -92,7 +92,7 @@ func testHandler(t testing.TB) {
9292 },
9393 }
9494 externalBuf := & bytes.Buffer {}
95- enc := expfmt .NewEncoder (externalBuf , expfmt .FmtProtoDelim )
95+ enc := expfmt .NewEncoder (externalBuf , expfmt .NewFormat ( expfmt . TypeProtoDelim ) )
9696 if err := enc .Encode (externalMetricFamily ); err != nil {
9797 t .Fatal (err )
9898 }
@@ -162,7 +162,7 @@ metric: <
162162 },
163163 }
164164 buf := & bytes.Buffer {}
165- enc = expfmt .NewEncoder (buf , expfmt .FmtProtoDelim )
165+ enc = expfmt .NewEncoder (buf , expfmt .NewFormat ( expfmt . TypeProtoDelim ) )
166166 if err := enc .Encode (expectedMetricFamily ); err != nil {
167167 t .Fatal (err )
168168 }
@@ -361,7 +361,7 @@ collected metric "broken_metric" { label:<name:"foo" value:"bar" > label:<name:"
361361 },
362362 out : output {
363363 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 ` ,
365365 },
366366 body : []byte {},
367367 },
@@ -372,7 +372,7 @@ collected metric "broken_metric" { label:<name:"foo" value:"bar" > label:<name:"
372372 },
373373 out : output {
374374 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 ` ,
376376 },
377377 body : []byte {},
378378 },
@@ -383,7 +383,7 @@ collected metric "broken_metric" { label:<name:"foo" value:"bar" > label:<name:"
383383 },
384384 out : output {
385385 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 ` ,
387387 },
388388 body : []byte {},
389389 },
@@ -394,7 +394,7 @@ collected metric "broken_metric" { label:<name:"foo" value:"bar" > label:<name:"
394394 },
395395 out : output {
396396 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 ` ,
398398 },
399399 body : []byte {},
400400 },
@@ -405,7 +405,7 @@ collected metric "broken_metric" { label:<name:"foo" value:"bar" > label:<name:"
405405 },
406406 out : output {
407407 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 ` ,
409409 },
410410 body : expectedMetricFamilyAsText ,
411411 },
@@ -417,7 +417,7 @@ collected metric "broken_metric" { label:<name:"foo" value:"bar" > label:<name:"
417417 },
418418 out : output {
419419 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 ` ,
421421 },
422422 body : expectedMetricFamilyAsBytes ,
423423 },
@@ -429,7 +429,7 @@ collected metric "broken_metric" { label:<name:"foo" value:"bar" > label:<name:"
429429 },
430430 out : output {
431431 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 ` ,
433433 },
434434 body : externalMetricFamilyAsText ,
435435 },
@@ -441,7 +441,7 @@ collected metric "broken_metric" { label:<name:"foo" value:"bar" > label:<name:"
441441 },
442442 out : output {
443443 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 ` ,
445445 },
446446 body : externalMetricFamilyAsBytes ,
447447 },
@@ -453,7 +453,7 @@ collected metric "broken_metric" { label:<name:"foo" value:"bar" > label:<name:"
453453 },
454454 out : output {
455455 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 ` ,
457457 },
458458 body : bytes .Join (
459459 [][]byte {
@@ -472,7 +472,7 @@ collected metric "broken_metric" { label:<name:"foo" value:"bar" > label:<name:"
472472 },
473473 out : output {
474474 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 ` ,
476476 },
477477 body : []byte {},
478478 },
@@ -483,7 +483,7 @@ collected metric "broken_metric" { label:<name:"foo" value:"bar" > label:<name:"
483483 },
484484 out : output {
485485 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 ` ,
487487 },
488488 body : expectedMetricFamilyAsText ,
489489 },
@@ -495,7 +495,7 @@ collected metric "broken_metric" { label:<name:"foo" value:"bar" > label:<name:"
495495 },
496496 out : output {
497497 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 ` ,
499499 },
500500 body : bytes .Join (
501501 [][]byte {
@@ -514,7 +514,7 @@ collected metric "broken_metric" { label:<name:"foo" value:"bar" > label:<name:"
514514 },
515515 out : output {
516516 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 ` ,
518518 },
519519 body : bytes .Join (
520520 [][]byte {
@@ -533,7 +533,7 @@ collected metric "broken_metric" { label:<name:"foo" value:"bar" > label:<name:"
533533 },
534534 out : output {
535535 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 ` ,
537537 },
538538 body : bytes .Join (
539539 [][]byte {
@@ -552,7 +552,7 @@ collected metric "broken_metric" { label:<name:"foo" value:"bar" > label:<name:"
552552 },
553553 out : output {
554554 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 ` ,
556556 },
557557 body : bytes .Join (
558558 [][]byte {
@@ -571,7 +571,7 @@ collected metric "broken_metric" { label:<name:"foo" value:"bar" > label:<name:"
571571 },
572572 out : output {
573573 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 ` ,
575575 },
576576 body : bytes .Join (
577577 [][]byte {
@@ -609,7 +609,7 @@ collected metric "broken_metric" { label:<name:"foo" value:"bar" > label:<name:"
609609 },
610610 out : output {
611611 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 ` ,
613613 },
614614 body : expectedMetricFamilyAsText ,
615615 },
@@ -666,7 +666,7 @@ collected metric "broken_metric" { label:<name:"foo" value:"bar" > label:<name:"
666666 },
667667 out : output {
668668 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 ` ,
670670 },
671671 body : bytes .Join (
672672 [][]byte {
0 commit comments