-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simplify metrics reporting #817
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -306,39 +306,30 @@ func (s *server) channelHandleWrapper(handler ChannelHandler, handlerFunc Channe | |
} | ||
|
||
if channel != nil { | ||
// if we have a channel but no events were created, we still log this to metrics | ||
cw := s.Backend().CloudWatch() | ||
channelTypeDim := cwatch.Dimension("ChannelType", string(channel.ChannelType())) | ||
|
||
// if we have a channel but no events were created, we still log this to metrics | ||
if len(events) == 0 { | ||
if hErr != nil { | ||
s.Backend().CloudWatch().Queue( | ||
cwatch.Datum("ChannelError", float64(secondDuration), types.StandardUnitSeconds, channelTypeDim), | ||
) | ||
cw.Queue(cwatch.Datum("ChannelError", float64(secondDuration), types.StandardUnitSeconds, channelTypeDim)) | ||
} else { | ||
s.Backend().CloudWatch().Queue( | ||
cwatch.Datum("ChannelIgnored", float64(secondDuration), types.StandardUnitSeconds, channelTypeDim), | ||
) | ||
cw.Queue(cwatch.Datum("ChannelIgnored", float64(secondDuration), types.StandardUnitSeconds, channelTypeDim)) | ||
} | ||
} | ||
|
||
for _, event := range events { | ||
switch e := event.(type) { | ||
case MsgIn: | ||
clog.SetAttached(true) | ||
s.Backend().CloudWatch().Queue( | ||
cwatch.Datum("MsgReceive", float64(secondDuration), types.StandardUnitSeconds, channelTypeDim), | ||
) | ||
cw.Queue(cwatch.Datum("MsgReceive", float64(secondDuration), types.StandardUnitSeconds, channelTypeDim)) | ||
LogMsgReceived(r, e) | ||
case StatusUpdate: | ||
clog.SetAttached(true) | ||
s.Backend().CloudWatch().Queue( | ||
cwatch.Datum("MsgStatus", float64(secondDuration), types.StandardUnitSeconds, channelTypeDim), | ||
) | ||
cw.Queue(cwatch.Datum("MsgStatus", float64(secondDuration), types.StandardUnitSeconds, channelTypeDim)) | ||
LogMsgStatusReceived(r, e) | ||
case ChannelEvent: | ||
s.Backend().CloudWatch().Queue( | ||
cwatch.Datum("EventReceive", float64(secondDuration), types.StandardUnitSeconds, channelTypeDim), | ||
) | ||
cw.Queue(cwatch.Datum("EventReceive", float64(secondDuration), types.StandardUnitSeconds, channelTypeDim)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure about any of these metrics... they're all measuring the overall handler time.. but if a handler produces multiple events/messages... the same data is reported multiple times. Seems like we want a single handler latency metric? @ericnewcomer @norkans7 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Discussed with @ericnewcomer and we're gonna try turning these into counts that are reported each minute in the backend heartbeat |
||
LogChannelEventReceived(r, e) | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since the namespace is
Temba/Courier
app doesn't make sense as a dimension.. can update mailroom to match this