Skip to content

fix(temporal): pass Exception directly to span.log(error=...)#611

Merged
Abhijeet Prasad (AbhiPrasad) merged 1 commit into
mainfrom
fix/temporal-error-logging-spec-compliance
Jul 21, 2026
Merged

fix(temporal): pass Exception directly to span.log(error=...)#611
Abhijeet Prasad (AbhiPrasad) merged 1 commit into
mainfrom
fix/temporal-error-logging-spec-compliance

Conversation

@starfolkai

@starfolkai starfolkai Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Summary

  • The integrations spec (instrumentation guide) requires passing the raw Exception to span.log(error=...) so Braintrust can extract exception type + traceback. The activity and workflow error paths were calling str(e) first, losing that structure.
  • Also trim redundant comments and docstrings that only restated what the code already says (kept the ones explaining non-obvious behavior: sandbox eager init, replay-safety semantics, temporalio version-kwarg compat).

Test plan

  • cd py && nox -s "test_temporal(latest)" -- -k "TestHeaderSerialization or TestWorkflowSpanContext or test_contrib_temporal_compat" — 9/9 pass
  • cd py && nox -s "test_temporal(latest)" -- -k "test_plugin_basic_workflow_tracing or test_plugin_activity_retry_tracing" — 2/2 pass (retry test exercises the new error=e path against a real Temporal test server)

🤖 Generated with Claude Code

Created by abhijeet

Slack thread

The integrations spec requires passing the Exception instance to
span.log so Braintrust can extract type + traceback. Stringifying
the exception in the activity and workflow error paths dropped
that structure. Also trim redundant explanatory comments and
docstrings that only restated the code.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@AbhiPrasad
Abhijeet Prasad (AbhiPrasad) merged commit eccb0e3 into main Jul 21, 2026
82 checks passed
@AbhiPrasad
Abhijeet Prasad (AbhiPrasad) deleted the fix/temporal-error-logging-spec-compliance branch July 21, 2026 19:13
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.

2 participants