Record exceptions on spans when callbacks throw or reject#102
Merged
Conversation
The span() function now catches sync throws and async rejections, recording the exception event, setting ERROR status, upgrading the log level, and computing a fingerprint — matching the Python SDK's behavior. Fixes #101
jgpruitt
added a commit
to timescale/memory-engine
that referenced
this pull request
Apr 9, 2026
Upstream fix (pydantic/logfire-js#102) makes span() automatically record exceptions and set ERROR status on throw/reject, matching the Python SDK. - Upgrade @pydantic/logfire-node ^0.13.0 → ^0.13.1 - Delete 5 identical telemetry.ts workaround files - Switch all span() imports to @pydantic/logfire-node - Drop unused direct @opentelemetry/api dependencies
jgpruitt
added a commit
to timescale/memory-engine
that referenced
this pull request
Apr 9, 2026
Upstream fix (pydantic/logfire-js#102) makes span() automatically record exceptions and set ERROR status on throw/reject, matching the Python SDK. - Upgrade @pydantic/logfire-node ^0.13.0 → ^0.13.1 - Delete 5 identical telemetry.ts workaround files - Switch all span() imports to @pydantic/logfire-node - Drop unused direct @opentelemetry/api dependencies
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
span()now catches sync throws and async rejections from realPromiseresults, recording the exception on the span before re-throwingspan()defensive around arbitrary thenables: lazy thenables are returned untouched rather than eagerly subscribing via.then(), while preserving the existingfinally()fallback for the zone.js promise caserecordSpanExceptionhelper that callsrecordException, setsERRORstatus, upgrades log level, and computes a fingerprintLogfireSpan.__exit__behavior for synchronous throws and promise rejectionsFixes #101