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.bind): Convert counters to uint64 #16015

Merged
merged 3 commits into from
Oct 30, 2024

Conversation

srebhan
Copy link
Member

@srebhan srebhan commented Oct 14, 2024

Summary

The bind implementation of the XML v3 endpoint reports counters as unsigned integers through XML. However, the current implementation of the plugin tries to convert those numbers to signed integers which fails for large values of counters leading to a parsing error as shown in the related issue.

This PR changes the internal representation of the counters to unsigned integers for the XML v3 implementation. The PR also adds a report_counters_as_int to keep the current, backward-compatible behavior of reporting those counters as signed integer fields. To avoid type conflicts and keep backward-compatibility the default behavior is to continue reporting those counters as integers.

However, users should change the setting to false as soon as possible to avoid parsing errors!

Checklist

  • No AI generated code was used in this PR

Related issues

resolves #15866

@telegraf-tiger telegraf-tiger bot added fix pr to fix corresponding bug plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins labels Oct 14, 2024
@srebhan srebhan self-assigned this Oct 14, 2024
@rumanmaharjan
Copy link

not able to download package. is it included on v1.32.1 [2024-10-07] ?

@srebhan
Copy link
Member Author

srebhan commented Oct 28, 2024

@rumanmaharjan I retriggered building of the packages. Please note, those packages will be deleted after 3 days IIRC so it would be good if you could at least download the package before it is removed again...

@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 Oct 29, 2024
@srebhan srebhan assigned DStrand1 and unassigned srebhan Oct 29, 2024
Copy link
Member

@DStrand1 DStrand1 left a comment

Choose a reason for hiding this comment

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

@srebhan Could you also rebase this PR to fix the changelog merge conflict? Thanks!

plugins/inputs/bind/bind.go Outdated Show resolved Hide resolved
@DStrand1 DStrand1 assigned srebhan and unassigned DStrand1 Oct 29, 2024
@srebhan srebhan assigned DStrand1 and unassigned srebhan Oct 30, 2024
@srebhan srebhan requested a review from DStrand1 October 30, 2024 10:44
@DStrand1 DStrand1 merged commit 9c8196f into influxdata:master Oct 30, 2024
27 checks passed
@github-actions github-actions bot added this to the v1.32.3 milestone Oct 30, 2024
srebhan added a commit that referenced this pull request Nov 18, 2024
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 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.

Input: Bind - strconv.ParseInt : value out of range
3 participants