-
-
Notifications
You must be signed in to change notification settings - Fork 210
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Client reports now include dropped spans (#3463)
- Loading branch information
1 parent
d886351
commit 5b35d8e
Showing
12 changed files
with
153 additions
and
22 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
26 changes: 26 additions & 0 deletions
26
test/Sentry.Tests/Internals/Extensions/ClientReportExtensionsTests.cs
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
namespace Sentry.Tests.Internals.Extensions; | ||
|
||
public class ClientReportExtensionsTests | ||
{ | ||
[Fact] | ||
public void EnvelopeContainsTransaction_ReportsDroppedSpans() | ||
{ | ||
// Arrange | ||
var recorder = Substitute.For<IClientReportRecorder>(); | ||
var hub = Substitute.For<IHub>(); | ||
var tracer = new TransactionTracer(hub, "name", "op"); | ||
var span1 = (SpanTracer)tracer.StartChild(null, tracer.SpanId, "span1"); | ||
tracer.StartChild(null, span1.SpanId, "span2"); | ||
tracer.StartChild(null, tracer.SpanId, "span3"); | ||
var transaction = new SentryTransaction(tracer); | ||
var envelope = Envelope.FromTransaction(transaction); | ||
|
||
// Act | ||
recorder.RecordDiscardedEvents(DiscardReason.EventProcessor, envelope); | ||
|
||
// Assert | ||
recorder.Received(1).RecordDiscardedEvent(DiscardReason.EventProcessor, DataCategory.Transaction, 1); | ||
// 1 for each span + 1 for the transaction root span | ||
recorder.Received(1).RecordDiscardedEvent(DiscardReason.EventProcessor, DataCategory.Span, transaction.Spans.Count + 1); | ||
} | ||
} |
This file contains 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
This file contains 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
This file contains 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