@@ -70,7 +70,7 @@ func TestBasicMetric(t *testing.T) {
7070 metric := controller .metrics .GetCustomMetric (metricDesc ).(prometheus.Gauge )
7171 metricString , err := getMetricStringValue (metric )
7272 assert .NoError (t , err )
73- assert .Contains (t , metricString , `label:< name:"name" value:"random-int" > gauge:< value:` )
73+ assert .Contains (t , metricString , `label:{ name:"name" value:"random-int"} gauge:{ value:` )
7474}
7575
7676var gaugeMetric = `
@@ -148,22 +148,22 @@ func TestGaugeMetric(t *testing.T) {
148148 metricAddGauge := controller .metrics .GetCustomMetric (metricAddDesc ).(prometheus.Gauge )
149149 metricAddGaugeValue , err := getMetricStringValue (metricAddGauge )
150150 assert .NoError (t , err )
151- assert .Contains (t , metricAddGaugeValue , `label:< name:"name" value:"random-int" > gauge:< value:10 > ` )
151+ assert .Contains (t , metricAddGaugeValue , `label:{ name:"name" value:"random-int"} gauge:{ value:10} ` )
152152
153153 metricSubGauge := controller .metrics .GetCustomMetric (metricSubDesc ).(prometheus.Gauge )
154154 metricSubGaugeValue , err := getMetricStringValue (metricSubGauge )
155155 assert .NoError (t , err )
156- assert .Contains (t , metricSubGaugeValue , `label:< name:"name" value:"random-int" > gauge:< value:-5 > ` )
156+ assert .Contains (t , metricSubGaugeValue , `label:{ name:"name" value:"random-int"} gauge:{ value:-5} ` )
157157
158158 metricSetGauge := controller .metrics .GetCustomMetric (metricSetDesc ).(prometheus.Gauge )
159159 metricSetGaugeValue , err := getMetricStringValue (metricSetGauge )
160160 assert .NoError (t , err )
161- assert .Contains (t , metricSetGaugeValue , `label:< name:"name" value:"random-int" > gauge:< value:50 > ` )
161+ assert .Contains (t , metricSetGaugeValue , `label:{ name:"name" value:"random-int"} gauge:{ value:50} ` )
162162
163163 metricDefaultGauge := controller .metrics .GetCustomMetric (metricDefaultDesc ).(prometheus.Gauge )
164164 metricDefaultGaugeValue , err := getMetricStringValue (metricDefaultGauge )
165165 assert .NoError (t , err )
166- assert .Contains (t , metricDefaultGaugeValue , `label:< name:"name" value:"random-int" > gauge:< value:15 > ` )
166+ assert .Contains (t , metricDefaultGaugeValue , `label:{ name:"name" value:"random-int"} gauge:{ value:15} ` )
167167}
168168
169169var counterMetric = `
@@ -221,13 +221,13 @@ func TestCounterMetric(t *testing.T) {
221221 metricTotalCounter := controller .metrics .GetCustomMetric (metricTotalDesc ).(prometheus.Counter )
222222 metricTotalCounterString , err := getMetricStringValue (metricTotalCounter )
223223 assert .NoError (t , err )
224- assert .Contains (t , metricTotalCounterString , `label:< name:"name" value:"flakey" > counter:< value:1 > ` )
224+ assert .Contains (t , metricTotalCounterString , `label:{ name:"name" value:"flakey"} counter:{ value:1` )
225225
226226 metricErrorCounter , ok := controller .metrics .GetCustomMetric (metricErrorDesc ).(prometheus.Counter )
227227 if ok {
228228 metricErrorCounterString , err := getMetricStringValue (metricErrorCounter )
229229 assert .NoError (t , err )
230- assert .Contains (t , metricErrorCounterString , `label:< name:"name" value:"flakey" > counter:< value:1 > ` )
230+ assert .Contains (t , metricErrorCounterString , `label:{ name:"name" value:"flakey"} counter:{ value:1` )
231231 }
232232}
233233
@@ -325,7 +325,7 @@ func TestMetricEmissionSameOperationCreationAndFailure(t *testing.T) {
325325 metricErrorCounter := controller .metrics .GetCustomMetric (metricErrorDesc ).(prometheus.Counter )
326326 metricErrorCounterString , err := getMetricStringValue (metricErrorCounter )
327327 assert .NoError (t , err )
328- assert .Contains (t , metricErrorCounterString , `counter:< value:1 > ` )
328+ assert .Contains (t , metricErrorCounterString , `counter:{ value:1 ` )
329329}
330330
331331var testRetryStrategyMetric = `
@@ -406,14 +406,14 @@ func TestRetryStrategyMetric(t *testing.T) {
406406 metricErrorCounter := controller .metrics .GetCustomMetric (metricErrorDesc ).(prometheus.Counter )
407407 metricErrorCounterString , err := getMetricStringValue (metricErrorCounter )
408408 assert .NoError (t , err )
409- assert .Contains (t , metricErrorCounterString , `counter:< value:1 > ` )
409+ assert .Contains (t , metricErrorCounterString , `counter:{ value:1 ` )
410410
411411 metricErrorDesc = wf .Spec .Templates [1 ].Metrics .Prometheus [0 ].GetDesc ()
412412 assert .NotNil (t , controller .metrics .GetCustomMetric (metricErrorDesc ))
413413 metricErrorCounter = controller .metrics .GetCustomMetric (metricErrorDesc ).(prometheus.Counter )
414414 metricErrorCounterString , err = getMetricStringValue (metricErrorCounter )
415415 assert .NoError (t , err )
416- assert .Contains (t , metricErrorCounterString , `counter:< value:1 > ` )
416+ assert .Contains (t , metricErrorCounterString , `counter:{ value:1 ` )
417417 }
418418}
419419
@@ -524,7 +524,7 @@ func TestDAGTmplMetrics(t *testing.T) {
524524 metricHistogram := controller .metrics .GetCustomMetric (metricDesc ).(prometheus.Histogram )
525525 metricHistogramString , err := getMetricStringValue (metricHistogram )
526526 assert .NoError (t , err )
527- assert .Contains (t , metricHistogramString , `histogram:< sample_count:1 sample_sum:5` )
527+ assert .Contains (t , metricHistogramString , `histogram:{ sample_count:1 sample_sum:5` )
528528
529529 tmpl = woc .wf .GetTemplateByName ("flakey" )
530530 assert .NotNil (t , tmpl )
@@ -533,7 +533,7 @@ func TestDAGTmplMetrics(t *testing.T) {
533533 metricCounter := controller .metrics .GetCustomMetric (metricDesc ).(prometheus.Counter )
534534 metricCounterString , err := getMetricStringValue (metricCounter )
535535 assert .NoError (t , err )
536- assert .Contains (t , metricCounterString , `counter:< value:1 > ` )
536+ assert .Contains (t , metricCounterString , `counter:{ value:1 ` )
537537}
538538
539539var testRealtimeWorkflowMetric = `
@@ -584,7 +584,7 @@ func TestRealtimeWorkflowMetric(t *testing.T) {
584584 metricErrorCounter := controller .metrics .GetCustomMetric (metricErrorDesc )
585585 metricErrorCounterString , err := getMetricStringValue (metricErrorCounter )
586586 assert .NoError (t , err )
587- assert .Contains (t , metricErrorCounterString , `label:< name:"workflowName" value:"test-foobar" > gauge:< value:` )
587+ assert .Contains (t , metricErrorCounterString , `label:{ name:"label" value:"foobar"} label:{name:" workflowName" value:"test-foobar"} gauge:{ value:` )
588588
589589 value1 , err := getMetricGaugeValue (controller .metrics .GetCustomMetric (metricErrorDesc ))
590590 assert .NoError (t , err )
@@ -651,7 +651,7 @@ func TestRealtimeWorkflowMetricWithGlobalParameters(t *testing.T) {
651651 metricErrorCounter := controller .metrics .GetCustomMetric (metricErrorDesc )
652652 metricErrorCounterString , err := getMetricStringValue (metricErrorCounter )
653653 assert .NoError (t , err )
654- assert .Contains (t , metricErrorCounterString , `label:< name:"workflowName" value:"test-foobar" > gauge:< value: ` )
654+ assert .Contains (t , metricErrorCounterString , `label:{ name:"label" value:"foobar"} label:{name:" workflowName" value:"test-foobar"} gauge:{ value` )
655655}
656656
657657var testProcessedRetryNode = `
0 commit comments