From adf17ccf469e333013e06c28a4ec02ff8ea4cce5 Mon Sep 17 00:00:00 2001 From: mflilian Date: Fri, 14 Oct 2022 17:41:40 -0300 Subject: [PATCH] add metricTagMap on handlers --- app/histories.go | 7 +++++++ app/history_v2_player_support.go | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/app/histories.go b/app/histories.go index fe4b7db..c49f6fe 100644 --- a/app/histories.go +++ b/app/histories.go @@ -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) } } diff --git a/app/history_v2_player_support.go b/app/history_v2_player_support.go index 24952ae..c69ad84 100644 --- a/app/history_v2_player_support.go +++ b/app/history_v2_player_support.go @@ -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) } }