-
Notifications
You must be signed in to change notification settings - Fork 9
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
[MM-60561] RTC client metrics #159
Conversation
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.
Just trying to understand better. :)
client/rtc_monitor.go
Outdated
avgJitter = (totalJitter / statsCount) | ||
avgLossRate = totalLossRate / statsCount |
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.
nit: brackets style
client/rtc_monitor.go
Outdated
avgJitter = (totalJitter / statsCount) | ||
avgLossRate = totalLost / totalReceived |
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.
same nit
(not important of course)
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.
I would have expected a linter to say something. Will review 👍
statsInterceptorFactory, err := stats.NewInterceptor() | ||
if err != nil { | ||
return fmt.Errorf("failed to create stats interceptor: %w", err) | ||
} | ||
var statsGetter stats.Getter | ||
statsInterceptorFactory.OnNewPeerConnection(func(_ string, g stats.Getter) { | ||
statsGetter = g | ||
}) | ||
i.Add(statsInterceptorFactory) |
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.
I'm not sure I fully understand this block here.... Oh, intercepter is provided by pion, and a pc always has a stats.Getter... I'm not sure what we do with this exact statsGetter
..?
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.
* Implement data channel message type * Update client implementation * Update godeltaprof * Fix dc init race * [MM-60561] RTC client metrics (#159) * Client metrics * Implement rtc stats monitor * Remove unnecessary parenthesis
* Allow signaling through data channel * Wrap tests * DC messages (#158) * Implement data channel message type * Update client implementation * Update godeltaprof * Fix dc init race * [MM-60561] RTC client metrics (#159) * Client metrics * Implement rtc stats monitor * Remove unnecessary parenthesis
Summary
PR adds support for receiving and tracking basic client metrics (round trip time, jitter and loss rate). These can then be easily surfaced through our existing Prometheus/Grafana stack (see screenshot).
I also added a basic Golang client implementation, however it's not very accurate given some limitations in the pion implementation (jitter is especially problematic). We are keeping these off by default so that we don't get wild reports from transcriber or other clients we may have in production.
Screenshot
Related PRs
mattermost/calls-common#41
Ticket Link
https://mattermost.atlassian.net/browse/MM-60561