Skip to content
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

[docker] fix net metrics in host mode #3313

Merged
merged 1 commit into from
Apr 20, 2017
Merged

Conversation

hkaj
Copy link
Member

@hkaj hkaj commented Apr 20, 2017

Note: Please remember to review the Datadog Contribution Guidelines
if you have not yet done so.

What does this PR do?

If a container is in host mode we shouldn't call socket.inet_aton on its network gateway because it's empty and will fail, resulting in a warning in the integration. We can't not report the metrics either because existing behavior reports network metrics even in host mode (so network metrics are actually for the whole host). So let's keep the same behavior but avoid the buggy call to inet_aton.

Motivation

Getting rid of a warning.

Testing Guidelines

Run the agent in host mode (or any other container on the same machine), see that the warning disappeared compared to the RC, replaced with a debug log.

@hkaj hkaj added this to the 5.13.0 milestone Apr 20, 2017
Copy link
Member

@truthbk truthbk left a comment

Choose a reason for hiding this comment

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

Looks good. My only question, or maybe consideration, is: could we have other interfaces in the mapping that should maybe be accounted for in host mode other than eth0?

@truthbk
Copy link
Member

truthbk commented Apr 20, 2017

We can discuss tomorrow, this is good regardless as far as I'm concerned. :shipit:

@truthbk truthbk merged commit 58d529f into master Apr 20, 2017
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.

None yet

2 participants