Skip to content

Commit 2902964

Browse files
authored
feat: adds User-Agent to distributor push logging (#17764)
1 parent 1bd319c commit 2902964

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pkg/loghttp/push/push.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,11 @@ func ParseRequest(logger log.Logger, userID string, maxRecvMsgSize int, r *http.
238238
logValues = append(logValues, "presumedAgentIp", strings.TrimSpace(agentIP))
239239
}
240240

241+
userAgent := r.Header.Get("User-Agent")
242+
if userAgent != "" {
243+
logValues = append(logValues, "userAgent", strings.TrimSpace(userAgent))
244+
}
245+
241246
logValues = append(logValues, pushStats.Extra...)
242247
level.Debug(logger).Log(logValues...)
243248

0 commit comments

Comments
 (0)