-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Add new TCP metrics for Network integration on Windows #18294
Conversation
if 'tcp4' in proto_dict and 'tcp6' in proto_dict: | ||
for fieldname, _ in tcpAllstats._fields_: | ||
tcp_sum = getattr(proto_dict['tcp4'], fieldname) + getattr(proto_dict['tcp6'], fieldname) | ||
setattr(tcpAllstats, fieldname, tcp_sum) | ||
proto_dict["tcp"] = tcpAllstats | ||
|
||
for proto, stats in proto_dict.items(): | ||
for fieldname in tcpstats_dict: | ||
fieldvalue = getattr(stats, fieldname) | ||
metric_name = "system.net." + str(proto) + tcpstats_dict[fieldname] | ||
self.submit_netmetric(metric_name, fieldvalue, tags) | ||
|
||
def _parse_protocol_psutil(self, conn): |
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.
Is this what Linux implementation has. Metrics for tcp4, tcp6 and just tcp?
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.
The linux implementation only submits the combined value for these metrics. The tcp4 and tcp6 metrics added by this change are not available on the linux implementation
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.
Looks good
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.
for consistency with other metrics
TCP4 -> TCP IPv4
TCP6 -> TCP IPv6
What does this PR do?
Adds new
system.net.tcp4.*
,system.net.tcp6.*
, andsystem.net.tcp.*
metrics using Microsoft's "GetTcpStatisticsEx":https://learn.microsoft.com/en-us/windows/win32/api/tcpmib/ns-tcpmib-mib_tcpstats2#members
Motivation
https://datadoghq.atlassian.net/browse/FRAGENT-2770
https://datadoghq.atlassian.net/browse/FRAGENT-2953
Additional Notes
Review checklist (to be filled by reviewers)
qa/skip-qa
label if the PR doesn't need to be tested during QA.backport/<branch-name>
label to the PR and it will automatically open a backport PR once this one is merged