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): Ignore startup-errors in test mode #15488

Merged
merged 1 commit into from
Jun 12, 2024

Conversation

srebhan
Copy link
Member

@srebhan srebhan commented Jun 11, 2024

Summary

When running Telegraf with --test startup errors of plugins are supposed to be logged and the plugin to be ignored. However, currently the plugin is added to the processing units despite reporting errors on startup. Therefore, the Gather() method of those erroneous plugins is called leading to problems due to partial startup (or no startup at all). As an example the following configuration

[[inputs.openstack]]
  username = "admin"
  password = "password"

will cause Telegraf to panic because parts of the internal plugin structure are not initialized but Gather() is called.

The PR ignores plugins reporting startup errors and makes Telegraf to behave as expected in testing mode.

Checklist

  • No AI generated code was used in this PR

Related issues

@telegraf-tiger telegraf-tiger bot added the fix pr to fix corresponding bug label Jun 11, 2024
@srebhan srebhan self-assigned this Jun 11, 2024
@telegraf-tiger
Copy link
Contributor

@srebhan srebhan 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 Jun 11, 2024
@srebhan srebhan assigned powersj and DStrand1 and unassigned srebhan Jun 11, 2024
@powersj powersj removed their assignment Jun 12, 2024
@DStrand1 DStrand1 merged commit caa0cf3 into influxdata:master Jun 12, 2024
27 checks passed
@github-actions github-actions bot added this to the v1.31.1 milestone Jun 12, 2024
srebhan added a commit that referenced this pull request Jul 1, 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.

3 participants