diff --git a/mapic/mistmetrics.go b/mapic/mistmetrics.go index f58e05e5..907c97b3 100644 --- a/mapic/mistmetrics.go +++ b/mapic/mistmetrics.go @@ -75,7 +75,7 @@ func (mc *mac) parsePlaybackID(line string) (string, bool) { func (mc *mac) enrichLabels(playbackID string) string { res := mc.streamLabel(playbackID) - res += ",catalyst=true" + res += `,catalyst="true"` si, err := mc.getStreamInfo(playbackID) if err != nil { glog.Warning("could not enrich Mist metrics for stream=%s err=%v", playbackID, err) diff --git a/mapic/mistmetrics_test.go b/mapic/mistmetrics_test.go index 17b20aee..02e943fd 100644 --- a/mapic/mistmetrics_test.go +++ b/mapic/mistmetrics_test.go @@ -42,10 +42,10 @@ func TestEnrichMistMetrics(t *testing.T) { expLines := []string{ `version{app="MistServer",version="729ddd4b42980d0124c72a46f13d8e0697293e94",release="Generic_x86_64"} 1`, - `mist_sessions{stream="video+077bh6xx5bx5tdua",catalyst=true,user_id="abcdefgh-123456789",sessType="viewers"}1`, - `mist_latency{stream="video+077bh6xx5bx5tdua",catalyst=true,user_id="abcdefgh-123456789",source="sin-prod-catalyst-3.lp-playback.studio"}1795`, - `mist_sessions{stream="video+51b13mqy7sgw520w",catalyst=true,user_id="hgfedcba-987654321",sessType="viewers"}5`, - `mist_latency{stream="video+51b13mqy7sgw520w",catalyst=true,user_id="hgfedcba-987654321",source="prg-prod-catalyst-0.lp-playback.studio"}1156`, + `mist_sessions{stream="video+077bh6xx5bx5tdua",catalyst="true",user_id="abcdefgh-123456789",sessType="viewers"}1`, + `mist_latency{stream="video+077bh6xx5bx5tdua",catalyst="true",user_id="abcdefgh-123456789",source="sin-prod-catalyst-3.lp-playback.studio"}1795`, + `mist_sessions{stream="video+51b13mqy7sgw520w",catalyst="true",user_id="hgfedcba-987654321",sessType="viewers"}5`, + `mist_latency{stream="video+51b13mqy7sgw520w",catalyst="true",user_id="hgfedcba-987654321",source="prg-prod-catalyst-0.lp-playback.studio"}1156`, } for _, exp := range expLines { require.Contains(t, resLines, exp)