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

fix(inputs.docker_log): Use correct name when matching containers #14874

Merged
merged 1 commit into from
Feb 23, 2024

Conversation

Kunnik
Copy link
Contributor

@Kunnik Kunnik commented Feb 22, 2024

Copied the fix from docker.go file.

Summary

This fix should change how docker logs plugin searches for the correct container name.
We found out that there was similar fix done in docker plugin few years ago.
#4376

Checklist

  • No AI generated code was used in this PR

Related issues

resolves #

Copied the fix from docker.go file.
@telegraf-tiger
Copy link
Contributor

Thanks so much for the pull request!
🤝 ✒️ Just a reminder that the CLA has not yet been signed, and we'll need it before merging. Please sign the CLA when you get a chance, then post a comment here saying !signed-cla

@telegraf-tiger telegraf-tiger bot added the fix pr to fix corresponding bug label Feb 22, 2024
@Kunnik
Copy link
Contributor Author

Kunnik commented Feb 22, 2024

!signed-cla

@telegraf-tiger
Copy link
Contributor

@srebhan srebhan changed the title fix: added check for the correct container name fix(inputs.docker_log): Use correct name when matching containers Feb 22, 2024
@telegraf-tiger telegraf-tiger bot added the plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins label Feb 22, 2024
Copy link
Member

@srebhan srebhan left a comment

Choose a reason for hiding this comment

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

Thanks for the fix @Kunnik!

@srebhan srebhan added area/docker ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review. labels Feb 22, 2024
Copy link
Contributor

@powersj powersj left a comment

Choose a reason for hiding this comment

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

This will break existing user's tags right? I think we should call this out in the readme as well. @srebhan thoughts?

@srebhan
Copy link
Member

srebhan commented Feb 23, 2024

@powersj I think it will filter out some instances that were output before. If you for example had two containers something/a and a it will now only output a and omits something/a. At least this is my understanding...

@Kunnik
Copy link
Contributor Author

Kunnik commented Feb 23, 2024

@powersj I think it will filter out some instances that were output before. If you for example had two containers something/a and a it will now only output a and omits something/a. At least this is my understanding...

Yeap, as was said in the issue I posted in the summary, docker sometimes report more container names for the one container in weird format "/container1/container2". At least in our case, there is always correct container name next to this complicated names in the array.

@powersj powersj merged commit 3929a42 into influxdata:master Feb 23, 2024
27 checks passed
@github-actions github-actions bot added this to the v1.30.0 milestone Feb 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/docker fix pr to fix corresponding bug plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants