-
Notifications
You must be signed in to change notification settings - Fork 814
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_daemon] [ecs] introspection resilience #2745
Conversation
|
9ac94d8
to
d44e084
Compare
6a5ee76
to
5f1c6f3
Compare
for line in f.readlines(): | ||
fields = line.strip().split() | ||
if fields[1] == '00000000': | ||
return socket.inet_ntoa(struct.pack('<L', int(fields[2], 16))) |
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.
We might need some fallback for Docker doesn't support ipv6-only, so we're good (for now).ipv6
only systems...
[docker_deamon] [ecs] add the ability to add the ecs (docker) gateway. [docker_daemon] [ecs] no need to raise, implicit in json() call. [docker_deamon] [ecs] get docker gw from /proc.
5f1c6f3
to
0a3e954
Compare
0a3e954
to
45cf3a8
Compare
port = ECS_INTROSPECT_DEFAULT_PORT | ||
elif not ip: | ||
ip = "localhost" | ||
port = ECS_INTROSPECT_DEFAULT_PORT |
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.
You could refactor the conditions to look like:
if not ip:
port = ECS_INTROSPECT_DEFAULT_PORT
if DockerUtil.is_dockerized() and self.docker_gateway:
ip = self.docker_gateway
else:
ip = 'localhost'
which is 1 line shorter \o/ (kidding aside I think it's also a bit clearer)
2 minor comments, feel free to merge once they're addressed 👍 |
c59ac6f
to
9b60949
Compare
I've pulled the image docker-dd-agent:latest but this change is not in there yet. When can I expect an updated image in the docker hub? |
I've tried the nightly build and I get an exception in refresh_ecs_tags |
Hi @himawri |
Note: Please remember to review the Datadog Contribution Guidelines
if you have not yet done so.
What does this PR do?
ECS agent container no longer has the IP address or ports available when we inspect its container to infer the introspection point. The docker gateway, typically at
172.17.0.1
is fine for constructing the url to query the API. We can set it as a parameter in the config file, or we can extract it from the agent's own information.Also, although rare, if the agent is not run dockerized, we can grab it
@localhost
Motivation
Our ECS task reporting broke due to our inability to query the endpoint.
Testing Guidelines
An overview on testing
is available in our contribution guidelines.
Additional Notes
Anything else we should know when reviewing?