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(agent): Warn on multple agent configuration tables seen #15402

Merged
merged 2 commits into from
May 31, 2024

Conversation

powersj
Copy link
Contributor

@powersj powersj commented May 24, 2024

Summary

Users sometimes try to use multiple agent sections, but this leads to undefined behavior. We should start to warn and eventually error on these types of issues.

Checklist

  • No AI generated code was used in this PR

@telegraf-tiger telegraf-tiger bot added the fix pr to fix corresponding bug label May 24, 2024
@powersj powersj marked this pull request as ready for review May 24, 2024 19:57
@Hipska
Copy link
Contributor

Hipska commented May 28, 2024

Isn't that doing just a merge of the 2? I see no issue in having these configs:

[agent]
interval = "30s"
[agent]
debug = true

@powersj
Copy link
Contributor Author

powersj commented May 29, 2024

I see no issue in having these configs:

Yes, your hand-crafted, limited example would not present any issues. It however gives the appearance that you can have multiple independent agent definitions, which is simply not true.

@powersj powersj added the ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review. label May 29, 2024
@Hipska
Copy link
Contributor

Hipska commented May 29, 2024

Sure, but I don't agree to "eventually error on these type of issues". I do have a valid use case to have multiple agent sections.

I agree to throw warnings or error out if those sections have overlapping parameters/items.

config/config.go Outdated Show resolved Hide resolved
@DStrand1 DStrand1 removed their assignment May 30, 2024
@srebhan srebhan merged commit 1829247 into influxdata:master May 31, 2024
27 checks passed
@github-actions github-actions bot added this to the v1.31.0 milestone May 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/agent fix pr to fix corresponding bug 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