Skip to content

Commit

Permalink
add metricTagMap on handlers
Browse files Browse the repository at this point in the history
  • Loading branch information
mflilian committed Oct 14, 2022
1 parent e14551c commit adf17cc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions app/histories.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,13 @@ func HistoriesHandler(app *App) func(c echo.Context) error {
gameID = topicsMessagesMap[topic][0].GameId
}
}

if len(messages) > 0 {
if metricTagsMap, ok := c.Get("metricTagsMap").(map[string]interface{}); ok {
metricTagsMap["gameID"] = gameID
}
}

return c.JSON(http.StatusOK, messages)
}
}
7 changes: 7 additions & 0 deletions app/history_v2_player_support.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@ func HistoriesV2PSHandler(app *App) func(c echo.Context) error {
},
)

if len(messages) > 0 {
gameId := messages[0].GameId
if metricTagsMap, ok := c.Get("metricTagsMap").(map[string]interface{}); ok {
metricTagsMap["gameID"] = gameId
}
}

return c.JSON(http.StatusOK, messages)
}
}
Expand Down

0 comments on commit adf17cc

Please sign in to comment.