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.mysql): Parse boolean values in metric v1 correctly #15063

Merged
merged 2 commits into from
Mar 27, 2024

Conversation

srebhan
Copy link
Member

@srebhan srebhan commented Mar 26, 2024

Summary

The current code for metric version 1 parses everything as an integer for global status queries. This leads to zero values for boolean values such as "ON" or "true" which are in turn perceived as "wrong" on the database side.

This PR fixes parsing of boolean values and emits a (single-time) warning for other values which might contain strings, floats etc resulting in zero values. The PR does not change the behavior for those other values to prevent changes of field-types for the metric output.

Checklist

  • No AI generated code was used in this PR

Related issues

resolves #6417

@telegraf-tiger telegraf-tiger bot added area/mysql fix pr to fix corresponding bug plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins labels Mar 26, 2024
@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 Mar 26, 2024
@srebhan srebhan assigned powersj and DStrand1 and unassigned srebhan Mar 26, 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.

Thanks! So it looks like the user always got 0 back, and this effectively unbreaks them by allowing for a 1 when it is on or true.

@powersj powersj assigned DStrand1 and unassigned DStrand1 and powersj Mar 26, 2024
@DStrand1 DStrand1 merged commit 8c4fd53 into influxdata:master Mar 27, 2024
26 checks passed
@github-actions github-actions bot added this to the v1.30.1 milestone Mar 27, 2024
powersj pushed a commit that referenced this pull request Apr 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/mysql 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.

wsrep reporting not working
3 participants