feat: Add AddToTransactions to SentryAttachment#5182
Open
jamescrosswell wants to merge 5 commits intomainfrom
Open
feat: Add AddToTransactions to SentryAttachment#5182jamescrosswell wants to merge 5 commits intomainfrom
jamescrosswell wants to merge 5 commits intomainfrom
Conversation
Adds an `AddToTransactions` boolean property to `SentryAttachment` (default `false`) that controls whether attachments are included in transaction envelopes. Previously attachments were never sent with transactions; now those with `AddToTransactions = true` are included. Closes #750 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5182 +/- ##
==========================================
+ Coverage 74.06% 74.09% +0.02%
==========================================
Files 501 506 +5
Lines 18113 18260 +147
Branches 3521 3568 +47
==========================================
+ Hits 13415 13529 +114
- Misses 3838 3859 +21
- Partials 860 872 +12 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Replace the optional-parameter signature with two explicit overloads: - original single-arg overload delegates to the new one (binary compat) - new overload takes logger + attachments without defaults Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The two focused tests (true includes, false excludes) already cover the filtering logic completely. The mixed-attachments test added no additional coverage. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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
AddToTransactionsboolean property toSentryAttachment(defaults tofalse)SentryAttachment(type, content, fileName, contentType, addToTransactions)Envelope.FromTransactionnow accepts optionalattachmentsparameter and includes those withAddToTransactions = trueSentryClient.CaptureTransactionfilters attachments to only passAddToTransactions = trueones to the envelopeImplements #750. See also the Java reference implementation and the SDK spec.
🤖 Generated with Claude Code