Skip to content

Commit

Permalink
append apiid to tracked endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
joshblakeley committed Sep 24, 2018
1 parent f8446b5 commit 2727f92
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions analytics.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 2727f92

Please sign in to comment.