Skip to content

fix: use struct field for deprecated metrics and guard against division by zero#146

Open
Aprazor wants to merge 1 commit intoczerwonk:mainfrom
Aprazor:fix/collector-struct-field-and-div-by-zero
Open

fix: use struct field for deprecated metrics and guard against division by zero#146
Aprazor wants to merge 1 commit intoczerwonk:mainfrom
Aprazor:fix/collector-struct-field-and-div-by-zero

Conversation

@Aprazor
Copy link
Copy Markdown

@Aprazor Aprazor commented Mar 20, 2026

Two fixes in Collect():

  1. Use p.enableDeprecatedMetrics (struct field) instead of the
    package-level enableDeprecatedMetrics variable, matching the
    pattern already used in Describe().
  2. Skip targets with PacketsSent == 0 to avoid emitting NaN for
    the loss metric (0/0 in IEEE 754).

…on by zero

Two fixes in Collect():
1. Use p.enableDeprecatedMetrics (struct field) instead of the
   package-level enableDeprecatedMetrics variable, matching the
   pattern already used in Describe().
2. Skip targets with PacketsSent == 0 to avoid emitting NaN for
   the loss metric (0/0 in IEEE 754).
@Aprazor Aprazor requested a review from czerwonk as a code owner March 20, 2026 21:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant