Skip to content

Commit

Permalink
Add 'catalyst=true' label to Mist-enriched metrics (#1367)
Browse files Browse the repository at this point in the history
  • Loading branch information
leszko authored Aug 26, 2024
1 parent ec0c2a4 commit c69d2fd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions mapic/mistmetrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ func (mc *mac) parsePlaybackID(line string) (string, bool) {

func (mc *mac) enrichLabels(playbackID string) string {
res := mc.streamLabel(playbackID)
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)
Expand Down
8 changes: 4 additions & 4 deletions mapic/mistmetrics_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",user_id="abcdefgh-123456789",sessType="viewers"}1`,
`mist_latency{stream="video+077bh6xx5bx5tdua",user_id="abcdefgh-123456789",source="sin-prod-catalyst-3.lp-playback.studio"}1795`,
`mist_sessions{stream="video+51b13mqy7sgw520w",user_id="hgfedcba-987654321",sessType="viewers"}5`,
`mist_latency{stream="video+51b13mqy7sgw520w",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)
Expand Down

0 comments on commit c69d2fd

Please sign in to comment.