log proto with msg

Signed-off-by: Chai Nadig <chaitanya.nadig@gmail.com>
This commit is contained in:
Chai Nadig 2020-05-13 23:57:01 -07:00
parent a75e588cf0
commit 4eac64eb59

View file

@ -65,7 +65,7 @@ func (l *StatsDUDPListener) HandlePacket(packet []byte) {
l.UDPPackets.Inc() l.UDPPackets.Inc()
lines := strings.Split(string(packet), "\n") lines := strings.Split(string(packet), "\n")
for _, line := range lines { for _, line := range lines {
level.Debug(l.Logger).Log("msg", "Incoming line", "line", line) level.Debug(l.Logger).Log("msg", "Incoming line", "proto", "udp", "line", line)
l.LinesReceived.Inc() l.LinesReceived.Inc()
l.EventHandler.Queue(pkgLine.LineToEvents(line, l.SampleErrors, l.SamplesReceived, l.TagErrors, l.TagsReceived, l.Logger)) l.EventHandler.Queue(pkgLine.LineToEvents(line, l.SampleErrors, l.SamplesReceived, l.TagErrors, l.TagsReceived, l.Logger))
} }
@ -121,7 +121,7 @@ func (l *StatsDTCPListener) HandleConn(c *net.TCPConn) {
} }
break break
} }
level.Debug(l.Logger).Log("msg", "Incoming line", "line", line) level.Debug(l.Logger).Log("msg", "Incoming line", "proto", "tcp", "line", line)
if isPrefix { if isPrefix {
l.TCPLineTooLong.Inc() l.TCPLineTooLong.Inc()
level.Debug(l.Logger).Log("msg", "Read failed: line too long", "addr", c.RemoteAddr()) level.Debug(l.Logger).Log("msg", "Read failed: line too long", "addr", c.RemoteAddr())
@ -170,7 +170,7 @@ func (l *StatsDUnixgramListener) HandlePacket(packet []byte) {
l.UnixgramPackets.Inc() l.UnixgramPackets.Inc()
lines := strings.Split(string(packet), "\n") lines := strings.Split(string(packet), "\n")
for _, line := range lines { for _, line := range lines {
level.Debug(l.Logger).Log("msg", "Incoming line", "line", line) level.Debug(l.Logger).Log("msg", "Incoming line", "proto", "unixgram", "line", line)
l.LinesReceived.Inc() l.LinesReceived.Inc()
l.EventHandler.Queue(pkgLine.LineToEvents(line, l.SampleErrors, l.SamplesReceived, l.TagErrors, l.TagsReceived, l.Logger)) l.EventHandler.Queue(pkgLine.LineToEvents(line, l.SampleErrors, l.SamplesReceived, l.TagErrors, l.TagsReceived, l.Logger))
} }