Skip to content

Comments

fix(inputs.upsd): Stop silently dropping mandatory variables from additional_fields#18367

Merged
mstrandboge merged 1 commit intoinfluxdata:masterfrom
skartikey:inputs_upsd_mandatory_variable
Feb 23, 2026
Merged

fix(inputs.upsd): Stop silently dropping mandatory variables from additional_fields#18367
mstrandboge merged 1 commit intoinfluxdata:masterfrom
skartikey:inputs_upsd_mandatory_variable

Conversation

@skartikey
Copy link
Contributor

Summary

  • Fix additional_fields silently dropping variables that overlap with the mandatory variable set (e.g., battery.runtime, device.model, device.serial, ups.firmware)
  • Remove the now-unused mandatoryVariableSet guard, which unconditionally skipped mandatory variables before the additional_fields filter was evaluated
  • No behavior change for default configs (no additional_fields configured)

Note

Users with additional_fields patterns matching mandatory variables
(e.g., battery.runtime, device.model) will see new raw fields
in their output alongside the existing converted forms. For example,
battery_runtime=4020i (raw seconds) will now appear alongside
time_left_ns=4020000000000i (nanoseconds). No existing fields are
removed or renamed.

Checklist

Related issues

resolves #18168

…itional_fields

When users configured additional_fields with patterns matching mandatory
variables (e.g., battery.runtime), those fields were unconditionally
skipped and never included in the output. Users only got the converted
mandatory form (e.g., time_left_ns in nanoseconds) but never the raw
field they explicitly requested (e.g., battery_runtime in seconds).

The mandatoryVariableSet skip was a defensive guard to prevent duplicate
fields, but it was redundant, mandatory variables are not in
defaultFieldSet, so without a filter they already hit the else-continue
path. Removing the skip lets the existing defaultFieldSet/filter/continue
logic handle mandatory variables naturally, while preserving all existing
behavior for default configs.
@skartikey skartikey self-assigned this Feb 17, 2026
@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 Feb 17, 2026
@telegraf-tiger
Copy link
Contributor

@skartikey skartikey assigned srebhan and unassigned skartikey Feb 19, 2026
Copy link
Member

@srebhan srebhan left a comment

Choose a reason for hiding this comment

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

Thanks @skartikey!

@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 Feb 20, 2026
@srebhan srebhan assigned mstrandboge and unassigned srebhan Feb 20, 2026
@mstrandboge mstrandboge merged commit 18a4f19 into influxdata:master Feb 23, 2026
26 of 27 checks passed
@github-actions github-actions bot added this to the v1.37.3 milestone Feb 23, 2026
mstrandboge pushed a commit that referenced this pull request Feb 23, 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.upsd] battery.runtime (and other fields) silently dropped from collection despite being in additional_fields and available from upsd

3 participants