Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
556ba4c
Added SentryOptions.SetBeforeSend
jamescrosswell May 2, 2023
a713108
Added tests for new CaptureHint overloads taking a Hint parameter
jamescrosswell May 2, 2023
36699e8
Failed requests add a Hint for the HttpResponseMessage
jamescrosswell May 2, 2023
baed55b
Added BeforeBreadcrumb Hint support (for breadcrumbs on the scope only)
jamescrosswell May 3, 2023
836ac09
- Fixed ScopeExtensionTests
jamescrosswell May 4, 2023
7b4efa1
Added stub of Android platform code to enable builds to complete
jamescrosswell May 4, 2023
52e5a33
Sentry.Samples.Console.Customized now demonstrates using hints with b…
jamescrosswell May 4, 2023
baee2ca
Added missing XML docs on Hint constructors
jamescrosswell May 4, 2023
d3dae05
Updated MiddlewareLoggerIntegration tests to account for modified imp…
jamescrosswell May 4, 2023
fb6e9cf
Updated verified tests for CaptureTransaction_BeforeSendTransactionTh…
jamescrosswell May 4, 2023
d211548
Tail chasing Verify test errors
jamescrosswell May 4, 2023
6c9be76
Merge branch 'main' into feat/hint-before-send
mattjohnsonpint May 6, 2023
c1c2777
Update CHANGELOG.md
mattjohnsonpint May 6, 2023
eded3b6
Fix iOS compilation issue
mattjohnsonpint May 6, 2023
6d78761
Moved hint data from base Hint class to Items property, for clarity
jamescrosswell May 7, 2023
9142abf
Added XML docs for Hint.Items property
jamescrosswell May 7, 2023
8868e47
Updated Customized console sample to use new Hint
jamescrosswell May 7, 2023
0f701eb
- Added Hints to BeforeSendTransaction
jamescrosswell May 8, 2023
25b61f4
Attachments from the Scope get included in Hints before adding Bookma…
jamescrosswell May 9, 2023
aa6d91e
Added hint support for Transaction/Event processors
jamescrosswell May 9, 2023
aa3750f
Merge remote-tracking branch 'getsentry/main' into feat/hint-before-send
jamescrosswell May 9, 2023
860af91
- Renamed Contextual processors to ProcessorWithHint (more specific)
jamescrosswell May 9, 2023
f27a650
Merge remote-tracking branch 'origin/main' into feat/hint-before-send
jamescrosswell May 10, 2023
afb18bd
Merge branch 'main' into feat/hint-before-send
mattjohnsonpint May 15, 2023
d02f33a
Add overloads without hints
mattjohnsonpint May 15, 2023
e382114
Cleanup Hint. Just expose Attachments, not AddAttachments.
mattjohnsonpint May 15, 2023
c3fdad4
Update API snapshots
mattjohnsonpint May 15, 2023
13c70d6
Ensure hint modifications to attachments are sent
mattjohnsonpint May 15, 2023
af95623
Update CHANGELOG.md
mattjohnsonpint May 15, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
- Renamed Contextual processors to ProcessorWithHint (more specific)
- Added overload to CaptureEvent to allow passing both Hint and ConfigureScope callback
  • Loading branch information
jamescrosswell committed May 9, 2023
commit 860af915dc072209aa3aa9327513f029572eb2f5
2 changes: 1 addition & 1 deletion src/Sentry/Extensibility/ISentryEventProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ internal static class ISentryEventProcessorExtensions
{
internal static SentryEvent? DoProcessEvent(this ISentryEventProcessor processor, SentryEvent @event, Hint hint)
{
return (processor is IContextualSentryEventProcessor contextualProcessor)
return (processor is ISentryEventProcessorWithHint contextualProcessor)
? contextualProcessor.Process(@event, hint)
: processor.Process(@event);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ namespace Sentry.Extensibility;
/// <summary>
/// Process a SentryEvent during the prepare phase.
/// </summary>
public interface IContextualSentryEventProcessor: ISentryEventProcessor
public interface ISentryEventProcessorWithHint: ISentryEventProcessor
{
/// <summary>
/// Process the <see cref="SentryEvent"/>
Expand All @@ -18,3 +18,4 @@ public interface IContextualSentryEventProcessor: ISentryEventProcessor
/// </remarks>
SentryEvent? Process(SentryEvent @event, Hint hint);
}

2 changes: 1 addition & 1 deletion src/Sentry/Extensibility/ISentryTransactionProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ internal static class ISentryTransactionProcessorExtensions
{
internal static Transaction? DoProcessTransaction(this ISentryTransactionProcessor processor, Transaction transaction, Hint hint)
{
return (processor is IContextualSentryTransactionProcessor contextualProcessor)
return (processor is ISentryTransactionProcessorWithHint contextualProcessor)
? contextualProcessor.Process(transaction, hint)
: processor.Process(transaction);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ namespace Sentry.Extensibility;
/// <summary>
/// Process a <see cref="Transaction"/> during the prepare phase.
/// </summary>
public interface IContextualSentryTransactionProcessor: ISentryTransactionProcessor
public interface ISentryTransactionProcessorWithHint: ISentryTransactionProcessor
{
/// <summary>
/// Process the <see cref="Transaction"/>
Expand Down
7 changes: 5 additions & 2 deletions src/Sentry/Internal/Hub.cs
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,10 @@ public void EndSession(SessionEndStatus status = SessionEndStatus.Exited) =>
return null;
}

public SentryId CaptureEvent(SentryEvent evt, Action<Scope> configureScope)
public SentryId CaptureEvent(SentryEvent evt, Action<Scope> configureScope) =>
CaptureEvent(evt, null, configureScope);

public SentryId CaptureEvent(SentryEvent evt, Hint? hint, Action<Scope> configureScope)
{
if (!IsEnabled)
{
Expand All @@ -306,7 +309,7 @@ public SentryId CaptureEvent(SentryEvent evt, Action<Scope> configureScope)
var clonedScope = ScopeManager.GetCurrent().Key.Clone();
configureScope(clonedScope);

return CaptureEvent(evt, clonedScope);
return CaptureEvent(evt, hint, clonedScope);
}
catch (Exception e)
{
Expand Down
16 changes: 8 additions & 8 deletions test/Sentry.Tests/ApiApprovalTests.Run.Core3_1.verified.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1255,14 +1255,6 @@ namespace Sentry.Extensibility
bool EnqueueEnvelope(Sentry.Protocol.Envelopes.Envelope envelope);
System.Threading.Tasks.Task FlushAsync(System.TimeSpan timeout);
}
public interface IContextualSentryEventProcessor : Sentry.Extensibility.ISentryEventProcessor
{
Sentry.SentryEvent? Process(Sentry.SentryEvent @event, Sentry.Hint hint);
}
public interface IContextualSentryTransactionProcessor : Sentry.Extensibility.ISentryTransactionProcessor
{
Sentry.Transaction? Process(Sentry.Transaction transaction, Sentry.Hint hint);
}
public interface IDiagnosticLogger
{
bool IsEnabled(Sentry.SentryLevel level);
Expand Down Expand Up @@ -1296,6 +1288,10 @@ namespace Sentry.Extensibility
{
Sentry.SentryEvent? Process(Sentry.SentryEvent @event);
}
public interface ISentryEventProcessorWithHint : Sentry.Extensibility.ISentryEventProcessor
{
Sentry.SentryEvent? Process(Sentry.SentryEvent @event, Sentry.Hint hint);
}
public interface ISentryStackTraceFactory
{
Sentry.SentryStackTrace? Create(System.Exception? exception = null);
Expand All @@ -1304,6 +1300,10 @@ namespace Sentry.Extensibility
{
Sentry.Transaction? Process(Sentry.Transaction transaction);
}
public interface ISentryTransactionProcessorWithHint : Sentry.Extensibility.ISentryTransactionProcessor
{
Sentry.Transaction? Process(Sentry.Transaction transaction, Sentry.Hint hint);
}
public interface ITransport
{
System.Threading.Tasks.Task SendEnvelopeAsync(Sentry.Protocol.Envelopes.Envelope envelope, System.Threading.CancellationToken cancellationToken = default);
Expand Down
16 changes: 8 additions & 8 deletions test/Sentry.Tests/ApiApprovalTests.Run.DotNet6_0.verified.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1256,14 +1256,6 @@ namespace Sentry.Extensibility
bool EnqueueEnvelope(Sentry.Protocol.Envelopes.Envelope envelope);
System.Threading.Tasks.Task FlushAsync(System.TimeSpan timeout);
}
public interface IContextualSentryEventProcessor : Sentry.Extensibility.ISentryEventProcessor
{
Sentry.SentryEvent? Process(Sentry.SentryEvent @event, Sentry.Hint hint);
}
public interface IContextualSentryTransactionProcessor : Sentry.Extensibility.ISentryTransactionProcessor
{
Sentry.Transaction? Process(Sentry.Transaction transaction, Sentry.Hint hint);
}
public interface IDiagnosticLogger
{
bool IsEnabled(Sentry.SentryLevel level);
Expand Down Expand Up @@ -1297,6 +1289,10 @@ namespace Sentry.Extensibility
{
Sentry.SentryEvent? Process(Sentry.SentryEvent @event);
}
public interface ISentryEventProcessorWithHint : Sentry.Extensibility.ISentryEventProcessor
{
Sentry.SentryEvent? Process(Sentry.SentryEvent @event, Sentry.Hint hint);
}
public interface ISentryStackTraceFactory
{
Sentry.SentryStackTrace? Create(System.Exception? exception = null);
Expand All @@ -1305,6 +1301,10 @@ namespace Sentry.Extensibility
{
Sentry.Transaction? Process(Sentry.Transaction transaction);
}
public interface ISentryTransactionProcessorWithHint : Sentry.Extensibility.ISentryTransactionProcessor
{
Sentry.Transaction? Process(Sentry.Transaction transaction, Sentry.Hint hint);
}
public interface ITransport
{
System.Threading.Tasks.Task SendEnvelopeAsync(Sentry.Protocol.Envelopes.Envelope envelope, System.Threading.CancellationToken cancellationToken = default);
Expand Down
16 changes: 8 additions & 8 deletions test/Sentry.Tests/ApiApprovalTests.Run.DotNet7_0.verified.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1256,14 +1256,6 @@ namespace Sentry.Extensibility
bool EnqueueEnvelope(Sentry.Protocol.Envelopes.Envelope envelope);
System.Threading.Tasks.Task FlushAsync(System.TimeSpan timeout);
}
public interface IContextualSentryEventProcessor : Sentry.Extensibility.ISentryEventProcessor
{
Sentry.SentryEvent? Process(Sentry.SentryEvent @event, Sentry.Hint hint);
}
public interface IContextualSentryTransactionProcessor : Sentry.Extensibility.ISentryTransactionProcessor
{
Sentry.Transaction? Process(Sentry.Transaction transaction, Sentry.Hint hint);
}
public interface IDiagnosticLogger
{
bool IsEnabled(Sentry.SentryLevel level);
Expand Down Expand Up @@ -1297,6 +1289,10 @@ namespace Sentry.Extensibility
{
Sentry.SentryEvent? Process(Sentry.SentryEvent @event);
}
public interface ISentryEventProcessorWithHint : Sentry.Extensibility.ISentryEventProcessor
{
Sentry.SentryEvent? Process(Sentry.SentryEvent @event, Sentry.Hint hint);
}
public interface ISentryStackTraceFactory
{
Sentry.SentryStackTrace? Create(System.Exception? exception = null);
Expand All @@ -1305,6 +1301,10 @@ namespace Sentry.Extensibility
{
Sentry.Transaction? Process(Sentry.Transaction transaction);
}
public interface ISentryTransactionProcessorWithHint : Sentry.Extensibility.ISentryTransactionProcessor
{
Sentry.Transaction? Process(Sentry.Transaction transaction, Sentry.Hint hint);
}
public interface ITransport
{
System.Threading.Tasks.Task SendEnvelopeAsync(Sentry.Protocol.Envelopes.Envelope envelope, System.Threading.CancellationToken cancellationToken = default);
Expand Down
16 changes: 8 additions & 8 deletions test/Sentry.Tests/ApiApprovalTests.Run.Net4_8.verified.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1254,14 +1254,6 @@ namespace Sentry.Extensibility
bool EnqueueEnvelope(Sentry.Protocol.Envelopes.Envelope envelope);
System.Threading.Tasks.Task FlushAsync(System.TimeSpan timeout);
}
public interface IContextualSentryEventProcessor : Sentry.Extensibility.ISentryEventProcessor
{
Sentry.SentryEvent? Process(Sentry.SentryEvent @event, Sentry.Hint hint);
}
public interface IContextualSentryTransactionProcessor : Sentry.Extensibility.ISentryTransactionProcessor
{
Sentry.Transaction? Process(Sentry.Transaction transaction, Sentry.Hint hint);
}
public interface IDiagnosticLogger
{
bool IsEnabled(Sentry.SentryLevel level);
Expand Down Expand Up @@ -1295,6 +1287,10 @@ namespace Sentry.Extensibility
{
Sentry.SentryEvent? Process(Sentry.SentryEvent @event);
}
public interface ISentryEventProcessorWithHint : Sentry.Extensibility.ISentryEventProcessor
{
Sentry.SentryEvent? Process(Sentry.SentryEvent @event, Sentry.Hint hint);
}
public interface ISentryStackTraceFactory
{
Sentry.SentryStackTrace? Create(System.Exception? exception = null);
Expand All @@ -1303,6 +1299,10 @@ namespace Sentry.Extensibility
{
Sentry.Transaction? Process(Sentry.Transaction transaction);
}
public interface ISentryTransactionProcessorWithHint : Sentry.Extensibility.ISentryTransactionProcessor
{
Sentry.Transaction? Process(Sentry.Transaction transaction, Sentry.Hint hint);
}
public interface ITransport
{
System.Threading.Tasks.Task SendEnvelopeAsync(Sentry.Protocol.Envelopes.Envelope envelope, System.Threading.CancellationToken cancellationToken = default);
Expand Down
4 changes: 2 additions & 2 deletions test/Sentry.Tests/HubTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1175,7 +1175,7 @@ public void CaptureTransaction_Client_Gets_ScopeAttachments()
public void CaptureTransaction_EventProcessor_Gets_Hint()
{
// Arrange
var processor = Substitute.For<IContextualSentryTransactionProcessor>();
var processor = Substitute.For<ISentryTransactionProcessorWithHint>();
processor.Process(Arg.Any<Transaction>(), Arg.Any<Hint>()).Returns(new Transaction("name", "operation"));
_fixture.Options.AddTransactionProcessor(processor);

Expand All @@ -1192,7 +1192,7 @@ public void CaptureTransaction_EventProcessor_Gets_Hint()
public void CaptureTransaction_EventProcessor_Gets_ScopeAttachments()
{
// Arrange
var processor = Substitute.For<IContextualSentryTransactionProcessor>();
var processor = Substitute.For<ISentryTransactionProcessorWithHint>();
Hint hint = null;
processor.Process(Arg.Any<Transaction>(), Arg.Do<Hint>(h => hint = h)).Returns(new Transaction("name", "operation"));
_fixture.Options.AddTransactionProcessor(processor);
Expand Down
4 changes: 2 additions & 2 deletions test/Sentry.Tests/SentryClientTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ public void CaptureEvent_BeforeSend_Gets_ScopeAttachments()
public void CaptureEvent_EventProcessor_Gets_Hint()
{
// Arrange
var processor = Substitute.For<IContextualSentryEventProcessor>();
var processor = Substitute.For<ISentryEventProcessorWithHint>();
processor.Process(Arg.Any<SentryEvent>(), Arg.Any<Hint>()).Returns(new SentryEvent());
_fixture.SentryOptions.AddEventProcessor(processor);

Expand All @@ -363,7 +363,7 @@ public void CaptureEvent_EventProcessor_Gets_Hint()
public void CaptureEvent_EventProcessor_Gets_ScopeAttachments()
{
// Arrange
var processor = Substitute.For<IContextualSentryEventProcessor>();
var processor = Substitute.For<ISentryEventProcessorWithHint>();
Hint hint = null;
processor.Process(Arg.Any<SentryEvent>(), Arg.Do<Hint>(h => hint = h)).Returns(new SentryEvent());
_fixture.SentryOptions.AddEventProcessor(processor);
Expand Down