Skip to content

Linux tcp stats#2070

Closed
maatthc wants to merge 7 commits into
DataDog:masterfrom
maatthc:linux_tcp_stats
Closed

Linux tcp stats#2070
maatthc wants to merge 7 commits into
DataDog:masterfrom
maatthc:linux_tcp_stats

Conversation

@maatthc

@maatthc maatthc commented Nov 12, 2015

Copy link
Copy Markdown

Added metrics from Linux stats:
/proc/net/sockstat
/proc/sys/net/ipv4/tcp_mem
/proc/sys/net/ipv4/tcp_max_orphans
/proc/sys/net/ipv4/netfilter/ip_conntrack_count
/proc/sys/net/ipv4/ip_conntrack_max Also from the command : /usr/bin/getconf PAGESIZE Those are critical metrics for high performance applications.

- /proc/net/sockstat
- /proc/sys/net/ipv4/tcp_mem
- /proc/sys/net/ipv4/tcp_max_orphans
- /proc/sys/net/ipv4/netfilter/ip_conntrack_count
- /proc/sys/net/ipv4/ip_conntrack_max
Also from the command :
 /usr/bin/getconf PAGESIZE
Those are critical metrics for high performance applications.
…rotocol - this way you don't need a WebServer running in front of the PHP_FPM process.
@remh

remh commented Nov 18, 2015

Copy link
Copy Markdown

Thanks a lot @maatthc !

Can you make sure to respect the contributing guidelines please?
https://github.com/DataDog/dd-agent/blob/master/CONTRIBUTING.md

Comment thread checks.d/network.py Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Call this with self., rather than with Network.

@JohnLZeller

Copy link
Copy Markdown
Contributor

@maatthc I think these metrics will be really useful once the check is cleaned up. Thanks for contributing!

Here is a summary of the notes I've made, that occur multiple times:

  • When calling the functions you've written, use self., rather than Network.
  • When opening a file, using with open(proc_name, 'r') as proc: instead is neater
  • If you're going to use self in a function, you need to either remove the decorator @staticmethod, or use @classmethod.
  • Nitpick: variable names shouldn't be camel case :)
  • I'm not entirely sure we want to return report a 0 value when we encounter an IOError. This seems to have the potential to misguide

Finally, many of your functions do the same thing, and could be condensed into a single function taking a string proc_name, and returning a value.

@maatthc would you also rebase this to be able to merge with master? There were some changes made to the network check that seem to be conflicting with your changes.

Comment thread checks.d/network.py Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't use print, if you need to output a string, use self.log.*

@remh remh modified the milestones: Triage, To be determined Jan 7, 2016
@irabinovitch

Copy link
Copy Markdown
Contributor

@maatthc Thank you for your contribution to the datadog agent. These look like great additions to the existing set of metrics we collect. Have you had a chance to review the feedback in code review here? We'd love to include this in an upcoming release.

@maatthc

maatthc commented Feb 25, 2016

Copy link
Copy Markdown
Author

Hi guys,
I've fixed all these items on my Repo. What should I do now? Close this pull request and raise a new one?

Cheers

@JohnLZeller

Copy link
Copy Markdown
Contributor

Thanks! No, you should squash your commits into one and then force push it up to your branch.

@maatthc

maatthc commented Feb 25, 2016

Copy link
Copy Markdown
Author

Okay,
Done!

@JohnLZeller

Copy link
Copy Markdown
Contributor

Thanks @maatthc! It looks like there are still merge conflicts with the master branch. Could you please try to resolve these conflicts, and then update this PR with the necessary changes?

@maatthc

maatthc commented Feb 25, 2016

Copy link
Copy Markdown
Author
Fixed conflict.

@remh remh modified the milestones: 5.8.0, Triage Feb 25, 2016
@JohnLZeller

Copy link
Copy Markdown
Contributor

@maatthc Could you please break out commit ba5a2c5 into a separate pr?

And, please squash the remaining commits here once you've done that :)

Comment thread checks.d/network.py

return metrics_by_interface

def _linux_sockstat_get_conntrack_max(self):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function body repeats itself in two others. Let's condense the three into one, passing in the proc_name, instead.

@JohnLZeller

Copy link
Copy Markdown
Contributor

Hey @maatthc :) Just pinging you again to see if you have time to make the changes I pointed out.

@JohnLZeller

Copy link
Copy Markdown
Contributor

Hey @maatthc just pinging again to see if you've had a chance to check this out

@olivielpeau olivielpeau modified the milestones: 5.9.0, 5.8.0 Apr 29, 2016
@irabinovitch

Copy link
Copy Markdown
Contributor

@maatthc We're going to move this out to 5.9 since there are still a few pending issues, and a 5.8 release is imminent.

@gmmeyer gmmeyer modified the milestones: 5.10.0, 5.9.0 Aug 12, 2016
@truthbk truthbk self-assigned this Jan 31, 2017
@truthbk

truthbk commented Feb 2, 2017

Copy link
Copy Markdown
Member

It seems like this PR has been inactive for a while, I think it should be re-opened in https://github.com/DataDog/integrations-core where the active development for the checks is now taking place. Thank you @maatthc!

@truthbk truthbk removed their assignment Feb 2, 2017
@irabinovitch

irabinovitch commented Feb 4, 2017

Copy link
Copy Markdown
Contributor

@maatthc Thank you again for your efforts here. The new metrics are indeed valuable and we would love to merge them. Unfortunately due to the age of the PR there are quite a few conflicts that would need to be addressed in addition the feedback from Remi, John and Jaime.

As we've not heard back in sometime I'm going to close out this PR, but I do hope you will open a a new one against our integrations repo at: https://github.com/DataDog/integrations-core

If you have any questions, we are happy to discuss here in this PR or on Slack in #integrations.

Thank you for being a member of our community and helping to make Datadog awesome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants