Skip to content

fix(inputs.vault): Decode float values of gauges and counters - #19733

Merged
srebhan merged 3 commits into
influxdata:masterfrom
skartikey:fix/vault-float-metrics
Sep 17, 2026
Merged

srebhan merged 3 commits into
influxdata:masterfrom
skartikey:fix/vault-float-metrics

Conversation

@skartikey

@skartikey skartikey commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Summary

Vault reports gauge values and the sum, min and max of counters as floating point numbers, but the plugin decoded them into integers. As soon as one of them has a fractional part, like vault.wal.write_controller.idle_secs in the linked issue, decoding the response fails and no metric is collected at all.

This PR always decodes those values as floats, so the response parses again. To avoid field type conflicts for existing users, the new float_values option defaults to false and keeps emitting integers by truncating the values, while float_values = true outputs the floats as reported by Vault. If the option is not set, a warning announces that the default changes to true in v1.45.0.

Checklist

Related issues

resolves #19672

@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 Sep 15, 2026
@skartikey skartikey self-assigned this Sep 15, 2026
@skartikey skartikey assigned srebhan and unassigned skartikey Sep 15, 2026
@skartikey skartikey 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 15, 2026

@srebhan srebhan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@skartikey we cannot do this change without a config setting as this will break nearly every user. Please add an option to keep ints by default with a warning about that the default for the option will change in say v1.45.0 outputting float values by default. We still keep the option to opt-out to the old types...
Then in v1.45.0 we deprecate the option for v1.50.0...

@skartikey
skartikey requested a review from srebhan September 17, 2026 06:32
@telegraf-tiger

Copy link
Copy Markdown
Contributor

Download PR build artifacts for linux_amd64.tar.gz, darwin_arm64.tar.gz, and windows_amd64.zip.
Downloads for additional architectures and packages are available below.

⚠️ This pull request increases the Telegraf binary size by 6.05 % for linux amd64 (new size: 326.9 MB, nightly size 308.2 MB)

📦 Click here to get additional PR build artifacts

Artifact URLs

. DEB . RPM . TAR . GZ . ZIP
amd64.deb aarch64.rpm darwin_amd64.tar.gz windows_amd64.zip
arm64.deb armel.rpm darwin_arm64.tar.gz windows_arm64.zip
armel.deb armv6hl.rpm freebsd_amd64.tar.gz windows_i386.zip
armhf.deb i386.rpm freebsd_armv7.tar.gz
i386.deb ppc64le.rpm freebsd_i386.tar.gz
mips.deb riscv64.rpm linux_amd64.tar.gz
mipsel.deb s390x.rpm linux_arm64.tar.gz
ppc64el.deb x86_64.rpm linux_armel.tar.gz
riscv64.deb linux_armhf.tar.gz
s390x.deb linux_i386.tar.gz
linux_mips.tar.gz
linux_mipsel.tar.gz
linux_ppc64le.tar.gz
linux_riscv64.tar.gz
linux_s390x.tar.gz

@srebhan srebhan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks @skartikey!

@srebhan
srebhan merged commit 7b4316a into influxdata:master Sep 17, 2026
31 checks passed
@github-actions github-actions Bot added this to the v1.40.1 milestone Sep 17, 2026
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.

inputs.vault: json cannot unmarshal number into Go struct field

2 participants