-
Notifications
You must be signed in to change notification settings - Fork 5k
[add_docker_metadata] log the error instead of returning it #47760
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
Conversation
🤖 GitHub commentsJust comment with:
|
|
This pull request does not have a backport label.
To fixup this pull request, you need to add the backport labels for the needed
|
5ab64ef to
f5e92f8
Compare
|
Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane) |
|
This pull request is now in conflicts. Could you fix it? 🙏 |
|
This should have a change entry |
|
Looking closer at elastic/elastic-agent-autodiscover#145 It seems like the add_docker_metadata already attempts to treat not having docker as non-fatal, but it doesn't handle errors from beats/libbeat/processors/add_docker_metadata/add_docker_metadata.go Lines 88 to 98 in 55629bc
Elastic Agent does this properly for example I'm not sure we need elastic/elastic-agent-autodiscover#145 to fix this, we should continue returning an error, and then at the call site log+ignore it. |
|
beats/libbeat/autodiscover/providers/docker/docker.go Lines 112 to 114 in 55629bc
This change will make the beats docker auto-discovery provider continue even if it can't start the docker watcher, which will probably make it sit there silently not working. This has to be explicitly configured from what I can tell so I'm not sure we want to change this globally, just fix |
|
@cmacknz Could you take a look when you're back? |
|
A couple suggestions on wording but the change otherwise LGTM |
|
Hit approve too early, we should add a test for this case. There is already a test for the no docker case before Start: beats/libbeat/processors/add_docker_metadata/add_docker_metadata_test.go Lines 100 to 113 in 55629bc
There is already a mock watcher in there which is probably what you have to modify to also test the start case. |
|
@cmacknz Done! |
|
CI is green on elastic-agent with this PR: elastic/elastic-agent#11374 |
* go.mod and notice * go.mod and notice * prometheus * fix watcher.Start() * changelog * dockerAvailable false * comments * unit test (cherry picked from commit 04732ce)
* go.mod and notice * go.mod and notice * prometheus * fix watcher.Start() * changelog * dockerAvailable false * comments * unit test (cherry picked from commit 04732ce)
This PR updates add_docker_metadata to log the error instead of returning it.
Relates elastic/elastic-agent#11171