chore: Remove whitespace, update variable naming (#13952)

This commit is contained in:
Joshua Powers 2023-09-20 07:36:11 -06:00 committed by GitHub
parent c65340ac7a
commit ac4cb12db8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 11 deletions

View File

@ -488,15 +488,15 @@ func (h *ConsumerGroupHandler) Handle(session sarama.ConsumerGroupSession, msg *
} }
// Check if any message header should be pass as tag // Check if any message header should be pass as tag
header_key := "" headerKey := ""
if len(h.MsgHeadersToTags) > 0 { if len(h.MsgHeadersToTags) > 0 {
for _, header := range msg.Headers { for _, header := range msg.Headers {
//convert to a string as the header and value are byte arrays. //convert to a string as the header and value are byte arrays.
header_key = string(header.Key) headerKey = string(header.Key)
if _, exists := h.MsgHeadersToTags[header_key]; exists { if _, exists := h.MsgHeadersToTags[headerKey]; exists {
// If message header should be pass as tag then add it to the metrics // If message header should be pass as tag then add it to the metrics
for _, metric := range metrics { for _, metric := range metrics {
metric.AddTag(header_key, string(header.Value)) metric.AddTag(headerKey, string(header.Value))
} }
} }
} }