Add new TCP metrics for Network integration on Windows#18294
Merged
Conversation
iglendd
reviewed
Aug 13, 2024
Comment on lines
+145
to
157
| 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): |
Contributor
There was a problem hiding this comment.
Is this what Linux implementation has. Metrics for tcp4, tcp6 and just tcp?
Collaborator
Author
There was a problem hiding this comment.
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
clarkb7
reviewed
Aug 23, 2024
clarkb7
left a comment
Contributor
There was a problem hiding this comment.
for consistency with other metrics
TCP4 -> TCP IPv4
TCP6 -> TCP IPv6
clarkb7
approved these changes
Aug 23, 2024
4 tasks
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-qalabel 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