Skip to content

Commit

Permalink
Include entry metadata bytes in metrics tracking ingestion stats
Browse files Browse the repository at this point in the history
  • Loading branch information
salvacorts committed Jul 13, 2023
1 parent aae13c3 commit a83baaa
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pkg/loghttp/push/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,10 @@ func ParseRequest(logger log.Logger, userID string, r *http.Request, tenantsRete
}
for _, e := range s.Entries {
totalEntries++
entriesSize += int64(len(e.Line))
bytesIngested.WithLabelValues(userID, retentionHours).Add(float64(int64(len(e.Line))))
bytesReceivedStats.Inc(int64(len(e.Line)))
entrySize := int64(len(e.Line)) + int64(len(e.Labels))
entriesSize += entrySize
bytesIngested.WithLabelValues(userID, retentionHours).Add(float64(entrySize))
bytesReceivedStats.Inc(entrySize)
if e.Timestamp.After(mostRecentEntry) {
mostRecentEntry = e.Timestamp
}
Expand Down

0 comments on commit a83baaa

Please sign in to comment.