From 2727f925f30f24048b08f4bd2b88511a08210ee1 Mon Sep 17 00:00:00 2001 From: joshblakeley Date: Mon, 24 Sep 2018 14:12:13 +0100 Subject: [PATCH] append apiid to tracked endpoints --- analytics.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/analytics.go b/analytics.go index 30a17fd910a9..8a55e9474612 100644 --- a/analytics.go +++ b/analytics.go @@ -273,10 +273,15 @@ func (r *RedisAnalyticsHandler) recordWorker() { // fix paths in record as they might have omitted leading "/" if !strings.HasPrefix(record.Path, "/") { record.Path = "/" + record.Path + } if !strings.HasPrefix(record.RawPath, "/") { record.RawPath = "/" + record.RawPath } + //if tracking path prepend apiid for grouping in aggregate queries + if record.TrackPath { + record.Path = record.APIID + ":" + record.Path + } if encoded, err := msgpack.Marshal(record); err != nil { log.WithError(err).Error("Error encoding analytics data")