Skip to content

Include occurrence in error telemetry events#173

Open
gaggle wants to merge 3 commits intoelixir-error-tracker:mainfrom
gaggle:include-occurrence-in-error-telemetry-events
Open

Include occurrence in error telemetry events#173
gaggle wants to merge 3 commits intoelixir-error-tracker:mainfrom
gaggle:include-occurrence-in-error-telemetry-events

Conversation

@gaggle
Copy link
Copy Markdown

@gaggle gaggle commented Apr 10, 2026

Hi @crbelaus,

We're a team that uses ErrorTracker, and we rely on its telemetry events to drive our alerting.

First off, thank you for building and maintaining this library, it's been great to use and work with!

We ran into a situation where the :new and :unresolved error events didn't carry enough information for us to make good alerting decisions. Specifically, we want to tell whether an error is genuinely new vs a
repeat, and when a previously-resolved error comes back we want to use alert routing based on the the occurrence's context.

The [:error_tracker, :occurrence, :new] event does carry the occurrence, but it fires for every occurrence regardless of whether the error is new, returning, or already known. So it wasn't the right signal for our use case.

We've been running a fork with these changes for a while and it's worked well for us. We wanted to offer this upstream in case you find the direction acceptable. We're happy to adjust the approach if you'd prefer
a different shape or semantics, please consider this a humble proposal rather than a prescription.

Changes

The :new and :unresolved error telemetry events now include the :occurrence in their metadata:

  • :new events carry the first occurrence, so consumers can inspect its context immediately.
  • :unresolved events (previously-resolved error re-occurs) carry the triggering occurrence.
  • :unresolved events (manual unresolve via UI) carry occurrence: nil since no new occurrence is involved.

The :resolved event is unchanged (no occurrence is relevant there).

Test plan

  • Existing telemetry test updated to assert :occurrence in :new event metadata.
  • Existing resolve/unresolve test updated to assert occurrence: nil for manual unresolves.
  • New test added for the "previously resolved error re-occurs" scenario.
  • Full suite passes with --warnings-as-errors

gaggle added 3 commits April 10, 2026 15:41
The :new error event now carries the occurrence in its metadata
so consumers can inspect context (e.g. to distinguish genuinely
new errors from noise) without a separate database query.
When a previously-resolved error re-occurs, the :unresolved event
now carries the triggering occurrence so consumers can inspect its
context (e.g. to decide whether to re-alert).

Manual unresolves (via the UI) emit occurrence: nil since there is
no new occurrence involved.
Reflect that :new and :unresolved error events now include the
occurrence in their metadata, and document the nullable semantics
for manual unresolves.
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