Skip to content

Preserve uint64 fingerprints in alert history and triage timelines #46

Description

@jpowersdev

Problem

Alert history fingerprints can lose precision when the backend returns an Alertmanager uint64 as a JSON number above Number.MAX_SAFE_INTEGER.

In a live read-only test with @jpowersdev/signoz@1.2.0, one alerts triage response represented the same labeled alert instance differently across sections:

  • topContributors[0].fingerprint: "13794282291722923096" (precision-preserving string)
  • matching timeline event fingerprint: 13794282291722924000 (rounded JavaScript number)

alerts history <rule-id> --output json emitted the same rounded numeric value.

The top-contributors endpoint already avoids this by rewriting large unquoted fingerprint values to strings before JSON.parse. Rule-history timeline decoding still goes through the generated client and loses precision first.

Impact

Automation cannot reliably join timeline/history events to top contributors or other Alertmanager data by fingerprint. The JSON type also differs between related command sections.

Reproduction

  1. Use a rule whose Alertmanager fingerprint exceeds Number.MAX_SAFE_INTEGER.
  2. Run signoz alerts triage <rule-id> --output json.
  3. Compare the sole top-contributor fingerprint with the matching timeline event.
  4. Run signoz alerts history <rule-id> --output json and compare again.

Acceptance criteria

  • Preserve exact uint64 fingerprints in alerts history and triage timeline output.
  • Emit fingerprints consistently as decimal strings across history, timeline, and top-contributor JSON.
  • Add tests using values above Number.MAX_SAFE_INTEGER that would otherwise round.
  • Keep existing table and stream output readable and backward-compatible where practical.
  • Do not regress the precision-safe top-contributor decoder.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions