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: Fix panic for non-existing metric names #9757

Merged
merged 2 commits into from
Sep 15, 2021

Conversation

srebhan
Copy link
Member

@srebhan srebhan commented Sep 14, 2021

Required for all PRs:

  • Updated associated README.md.
  • Wrote appropriate unit tests.
  • Pull request title or commits are in conventional commit format (e.g. feat: or fix:)

related to #9756

In case you specify a metric_name within a parser configuration section you will actually set a query to fill the metric name. If this query references a non-existing node the code will panic as the resulting nil value cannot be converted to string (see #9756). However, this might also happen in case you try to specify a constant metric name but omit the string('...') around that name.

Catch the panic before it occurs and add test cases to test it works correctly.

…ng node. This happens e.g. if you try to specify a constant but omit `string('...')`.
@telegraf-tiger telegraf-tiger bot added feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin new plugin plugin/parser 1. Request for new parser plugins 2. Issues/PRs that are related to parser plugins labels Sep 14, 2021
@sspaink sspaink added fix pr to fix corresponding bug and removed feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin labels Sep 14, 2021
Copy link
Contributor

@sspaink sspaink left a comment

Choose a reason for hiding this comment

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

lgtm!

@sspaink sspaink 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 Sep 14, 2021
@MyaLongmire MyaLongmire merged commit c076398 into influxdata:master Sep 15, 2021
reimda pushed a commit that referenced this pull request Sep 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix pr to fix corresponding bug new plugin plugin/parser 1. Request for new parser plugins 2. Issues/PRs that are related to parser 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.

3 participants