diff --git a/handlers/analytics.go b/handlers/analytics.go index d775025f..f6ffceea 100644 --- a/handlers/analytics.go +++ b/handlers/analytics.go @@ -123,13 +123,20 @@ func (c *AnalyticsHandlersCollection) Log() httprouter.Handle { cerrors.WriteHTTPBadRequest(w, "Invalid playback_id", nil) } - for _, ad := range c.toAnalyticsData(log, geo, extData) { + data := c.toAnalyticsData(log, geo, extData) + for i, ad := range data { select { case dataCh <- ad: // process data async default: - glog.Warningf("error processing analytics log, too many requests") + // Do some counting up of the different message types to give us a better picture of what's going on here + msgTypes := map[string]int{} + for _, msg := range data { + msgTypes[msg.EventType] += 1 + } + glog.Warningf("error processing analytics log, too many requests. Failed to write %d lines. Message types: %v", len(data)-i, msgTypes) cerrors.WriteHTTPInternalServerError(w, "error processing analytics log, too many requests", nil) + return } } }