diff --git a/test/Sentry.NLog.Tests/ApiApprovalTests.verify.cs b/test/Sentry.NLog.Tests/ApiApprovalTests.verify.cs index 796c9b7e5b..fdbad95ea1 100644 --- a/test/Sentry.NLog.Tests/ApiApprovalTests.verify.cs +++ b/test/Sentry.NLog.Tests/ApiApprovalTests.verify.cs @@ -3,7 +3,7 @@ namespace Sentry.NLog.Tests; [UsesVerify] public class ApiApprovalTests { - [SkippableFact] + [Fact] public Task Run() { return typeof(SentryTarget).Assembly.CheckApproval(); diff --git a/test/Sentry.NLog.Tests/IntegrationTests.verify.cs b/test/Sentry.NLog.Tests/IntegrationTests.verify.cs index 8782ce85c9..13cc47c8c4 100644 --- a/test/Sentry.NLog.Tests/IntegrationTests.verify.cs +++ b/test/Sentry.NLog.Tests/IntegrationTests.verify.cs @@ -3,7 +3,7 @@ [UsesVerify] public class IntegrationTests { - [SkippableFact] + [Fact] public Task Simple() { var transport = new RecordingTransport(); @@ -60,7 +60,7 @@ public Task Simple() .IgnoreStandardSentryMembers(); } - [SkippableFact] + [Fact] public Task LoggingInsideTheContextOfLogging() { var transport = new RecordingTransport(); diff --git a/test/Sentry.Tests/ApiApprovalTests.Run.Core3_1.verified.txt b/test/Sentry.Tests/ApiApprovalTests.Run.Core3_1.verified.txt index bb2834b791..01c207ea05 100644 --- a/test/Sentry.Tests/ApiApprovalTests.Run.Core3_1.verified.txt +++ b/test/Sentry.Tests/ApiApprovalTests.Run.Core3_1.verified.txt @@ -118,6 +118,9 @@ namespace Sentry } public static class EventLikeExtensions { + public static void AddBreadcrumb(this Sentry.IEventLike eventLike, string message, string? category, string? type, System.ValueTuple? dataPair = default, Sentry.BreadcrumbLevel level = 0) { } + public static void AddBreadcrumb(this Sentry.IEventLike eventLike, string message, string? category = null, string? type = null, System.Collections.Generic.IReadOnlyDictionary? data = null, Sentry.BreadcrumbLevel level = 0) { } + public static void AddBreadcrumb(this Sentry.IEventLike eventLike, System.DateTimeOffset? timestamp, string message, string? category = null, string? type = null, System.Collections.Generic.IReadOnlyDictionary? data = null, Sentry.BreadcrumbLevel level = 0) { } public static bool HasUser(this Sentry.IEventLike eventLike) { } public static void SetFingerprint(this Sentry.IEventLike eventLike, System.Collections.Generic.IEnumerable fingerprint) { } public static void SetFingerprint(this Sentry.IEventLike eventLike, params string[] fingerprint) { } @@ -128,12 +131,6 @@ namespace Sentry public FileAttachmentContent(string filePath, bool readFileAsynchronously) { } public System.IO.Stream GetStream() { } } - public static class HasBreadcrumbsExtensions - { - public static void AddBreadcrumb(this Sentry.IHasBreadcrumbs hasBreadcrumbs, string message, string? category, string? type, System.ValueTuple? dataPair = default, Sentry.BreadcrumbLevel level = 0) { } - public static void AddBreadcrumb(this Sentry.IHasBreadcrumbs hasBreadcrumbs, string message, string? category = null, string? type = null, System.Collections.Generic.IReadOnlyDictionary? data = null, Sentry.BreadcrumbLevel level = 0) { } - public static void AddBreadcrumb(this Sentry.IHasBreadcrumbs hasBreadcrumbs, System.DateTimeOffset? timestamp, string message, string? category = null, string? type = null, System.Collections.Generic.IReadOnlyDictionary? data = null, Sentry.BreadcrumbLevel level = 0) { } - } public static class HasExtraExtensions { public static void SetExtras(this Sentry.IHasExtra hasExtra, System.Collections.Generic.IEnumerable> values) { } @@ -192,22 +189,19 @@ namespace Sentry { System.IO.Stream GetStream(); } - public interface IEventLike : Sentry.IHasBreadcrumbs, Sentry.IHasExtra, Sentry.IHasTags + public interface IEventLike : Sentry.IHasExtra, Sentry.IHasTags { + System.Collections.Generic.IReadOnlyCollection Breadcrumbs { get; } Sentry.Contexts Contexts { get; set; } + string? Distribution { get; set; } string? Environment { get; set; } System.Collections.Generic.IReadOnlyList Fingerprint { get; set; } Sentry.SentryLevel? Level { get; set; } - string? Platform { get; set; } string? Release { get; set; } Sentry.Request Request { get; set; } Sentry.SdkVersion Sdk { get; } string? TransactionName { get; set; } Sentry.User User { get; set; } - } - public interface IHasBreadcrumbs - { - System.Collections.Generic.IReadOnlyCollection Breadcrumbs { get; } void AddBreadcrumb(Sentry.Breadcrumb breadcrumb); } public interface IHasExtra @@ -221,10 +215,6 @@ namespace Sentry void SetTag(string key, string value); void UnsetTag(string key); } - public interface IHasTransactionNameSource - { - Sentry.TransactionNameSource NameSource { get; } - } public interface IHub : Sentry.ISentryClient, Sentry.ISentryScopeManager { Sentry.SentryId LastEventId { get; } @@ -290,7 +280,7 @@ namespace Sentry System.DateTimeOffset StartTimestamp { get; } string? UserAgent { get; } } - public interface ISpan : Sentry.IHasExtra, Sentry.IHasTags, Sentry.ISpanContext, Sentry.ISpanData, Sentry.Protocol.ITraceContext + public interface ISpan : Sentry.IHasExtra, Sentry.IHasTags, Sentry.ISpanData, Sentry.Protocol.ITraceContext { new string? Description { get; set; } new string Operation { get; set; } @@ -301,27 +291,32 @@ namespace Sentry void Finish(System.Exception exception, Sentry.SpanStatus status); Sentry.ISpan StartChild(string operation); } - public interface ISpanContext : Sentry.Protocol.ITraceContext { } - public interface ISpanData : Sentry.IHasExtra, Sentry.IHasTags, Sentry.ISpanContext, Sentry.Protocol.ITraceContext + public interface ISpanData : Sentry.IHasExtra, Sentry.IHasTags, Sentry.Protocol.ITraceContext { System.DateTimeOffset? EndTimestamp { get; } bool IsFinished { get; } + System.Collections.Generic.IReadOnlyDictionary Measurements { get; } System.DateTimeOffset StartTimestamp { get; } Sentry.SentryTraceHeader GetTraceHeader(); + void SetMeasurement(string name, Sentry.Protocol.Measurement measurement); } - public interface ITransaction : Sentry.IEventLike, Sentry.IHasBreadcrumbs, Sentry.IHasExtra, Sentry.IHasTags, Sentry.ISpan, Sentry.ISpanContext, Sentry.ISpanData, Sentry.ITransactionContext, Sentry.ITransactionData, Sentry.Protocol.ITraceContext + public interface ITransaction : Sentry.IEventLike, Sentry.IHasExtra, Sentry.IHasTags, Sentry.ISpan, Sentry.ISpanData, Sentry.ITransactionContext, Sentry.ITransactionData, Sentry.Protocol.ITraceContext { new bool? IsParentSampled { get; set; } new string Name { get; set; } System.Collections.Generic.IReadOnlyCollection Spans { get; } Sentry.ISpan? GetLastActiveSpan(); } - public interface ITransactionContext : Sentry.ISpanContext, Sentry.Protocol.ITraceContext + public interface ITransactionContext : Sentry.Protocol.ITraceContext { bool? IsParentSampled { get; } string Name { get; } + Sentry.TransactionNameSource NameSource { get; } + } + public interface ITransactionData : Sentry.IEventLike, Sentry.IHasExtra, Sentry.IHasTags, Sentry.ISpanData, Sentry.ITransactionContext, Sentry.Protocol.ITraceContext + { + string? Platform { get; set; } } - public interface ITransactionData : Sentry.IEventLike, Sentry.IHasBreadcrumbs, Sentry.IHasExtra, Sentry.IHasTags, Sentry.ISpanContext, Sentry.ISpanData, Sentry.ITransactionContext, Sentry.Protocol.ITraceContext { } public enum InstructionAddressAdjustment { Auto = 0, @@ -334,14 +329,6 @@ namespace Sentry Sentry = 0, OpenTelemetry = 1, } - public static class MeasurementExtensions - { - public static void SetMeasurement(this Sentry.ITransactionData transaction, string name, double value, Sentry.MeasurementUnit unit = default) { } - public static void SetMeasurement(this Sentry.ITransactionData transaction, string name, int value, Sentry.MeasurementUnit unit = default) { } - public static void SetMeasurement(this Sentry.ITransactionData transaction, string name, long value, Sentry.MeasurementUnit unit = default) { } - [System.CLSCompliant(false)] - public static void SetMeasurement(this Sentry.ITransactionData transaction, string name, ulong value, Sentry.MeasurementUnit unit = default) { } - } public readonly struct MeasurementUnit : System.IEquatable { public static Sentry.MeasurementUnit None; @@ -421,7 +408,7 @@ namespace Sentry public void WriteTo(System.Text.Json.Utf8JsonWriter writer, Sentry.Extensibility.IDiagnosticLogger? logger) { } public static Sentry.Request FromJson(System.Text.Json.JsonElement json) { } } - public class Scope : Sentry.IEventLike, Sentry.IHasBreadcrumbs, Sentry.IHasExtra, Sentry.IHasTags + public class Scope : Sentry.IEventLike, Sentry.IHasExtra, Sentry.IHasTags { public Scope(Sentry.SentryOptions? options) { } public System.Collections.Generic.IReadOnlyCollection Attachments { get; } @@ -432,7 +419,6 @@ namespace Sentry public System.Collections.Generic.IReadOnlyDictionary Extra { get; } public System.Collections.Generic.IReadOnlyList Fingerprint { get; set; } public Sentry.SentryLevel? Level { get; set; } - public string? Platform { get; set; } public string? Release { get; set; } public Sentry.Request Request { get; set; } public Sentry.SdkVersion Sdk { get; } @@ -510,7 +496,7 @@ namespace Sentry public static System.Threading.Tasks.Task FlushAsync(this Sentry.ISentryClient client) { } } [System.Diagnostics.DebuggerDisplay("{GetType().Name,nq}: {EventId,nq}")] - public sealed class SentryEvent : Sentry.IEventLike, Sentry.IHasBreadcrumbs, Sentry.IHasExtra, Sentry.IHasTags, Sentry.IJsonSerializable + public sealed class SentryEvent : Sentry.IEventLike, Sentry.IHasExtra, Sentry.IHasTags, Sentry.IJsonSerializable { public SentryEvent() { } public SentryEvent(System.Exception? exception) { } @@ -810,7 +796,7 @@ namespace Sentry public System.Collections.Generic.IList FramesOmitted { get; } public string? Function { get; set; } public long? FunctionId { get; set; } - public long? ImageAddress { get; set; } + public long? ImageAddress { get; set; } public bool? InApp { get; set; } public long? InstructionAddress { get; set; } public int? LineNumber { get; set; } @@ -900,7 +886,7 @@ namespace Sentry public void WriteTo(System.Text.Json.Utf8JsonWriter writer, Sentry.Extensibility.IDiagnosticLogger? logger) { } public static Sentry.SessionUpdate FromJson(System.Text.Json.JsonElement json) { } } - public class Span : Sentry.IHasExtra, Sentry.IHasTags, Sentry.IJsonSerializable, Sentry.ISpanContext, Sentry.ISpanData, Sentry.Protocol.ITraceContext + public class Span : Sentry.IHasExtra, Sentry.IHasTags, Sentry.IJsonSerializable, Sentry.ISpanData, Sentry.Protocol.ITraceContext { public Span(Sentry.ISpan tracer) { } public Span(Sentry.SpanId? parentSpanId, string operation) { } @@ -909,6 +895,7 @@ namespace Sentry public System.Collections.Generic.IReadOnlyDictionary Extra { get; } public bool IsFinished { get; } public bool? IsSampled { get; } + public System.Collections.Generic.IReadOnlyDictionary Measurements { get; } public string Operation { get; set; } public Sentry.SpanId? ParentSpanId { get; } public Sentry.SpanId SpanId { get; } @@ -918,12 +905,13 @@ namespace Sentry public Sentry.SentryId TraceId { get; } public Sentry.SentryTraceHeader GetTraceHeader() { } public void SetExtra(string key, object? value) { } + public void SetMeasurement(string name, Sentry.Protocol.Measurement measurement) { } public void SetTag(string key, string value) { } public void UnsetTag(string key) { } public void WriteTo(System.Text.Json.Utf8JsonWriter writer, Sentry.Extensibility.IDiagnosticLogger? logger) { } public static Sentry.Span FromJson(System.Text.Json.JsonElement json) { } } - public class SpanContext : Sentry.ISpanContext, Sentry.Protocol.ITraceContext + public class SpanContext : Sentry.Protocol.ITraceContext { public SpanContext(Sentry.SpanId spanId, Sentry.SpanId? parentSpanId, Sentry.SentryId traceId, string operation, string? description, Sentry.SpanStatus? status, bool? isSampled) { } public string? Description { get; } @@ -935,6 +923,14 @@ namespace Sentry public Sentry.SpanStatus? Status { get; } public Sentry.SentryId TraceId { get; } } + public static class SpanDataExtensions + { + public static void SetMeasurement(this Sentry.ISpanData spanData, string name, double value, Sentry.MeasurementUnit unit = default) { } + public static void SetMeasurement(this Sentry.ISpanData spanData, string name, int value, Sentry.MeasurementUnit unit = default) { } + public static void SetMeasurement(this Sentry.ISpanData spanData, string name, long value, Sentry.MeasurementUnit unit = default) { } + [System.CLSCompliant(false)] + public static void SetMeasurement(this Sentry.ISpanData spanData, string name, ulong value, Sentry.MeasurementUnit unit = default) { } + } public static class SpanExtensions { public static Sentry.ITransaction GetTransaction(this Sentry.ISpan span) { } @@ -977,7 +973,7 @@ namespace Sentry OutOfRange = 15, DataLoss = 16, } - public class SpanTracer : Sentry.IHasExtra, Sentry.IHasTags, Sentry.ISpan, Sentry.ISpanContext, Sentry.ISpanData, Sentry.Protocol.ITraceContext + public class SpanTracer : Sentry.IHasExtra, Sentry.IHasTags, Sentry.ISpan, Sentry.ISpanData, Sentry.Protocol.ITraceContext { public SpanTracer(Sentry.IHub hub, Sentry.TransactionTracer transaction, Sentry.SpanId? parentSpanId, Sentry.SentryId traceId, string operation) { } public string? Description { get; set; } @@ -985,6 +981,7 @@ namespace Sentry public System.Collections.Generic.IReadOnlyDictionary Extra { get; } public bool IsFinished { get; } public bool? IsSampled { get; } + public System.Collections.Generic.IReadOnlyDictionary Measurements { get; } public string Operation { get; set; } public Sentry.SpanId? ParentSpanId { get; } public Sentry.SpanId SpanId { get; } @@ -998,6 +995,7 @@ namespace Sentry public void Finish(System.Exception exception, Sentry.SpanStatus status) { } public Sentry.SentryTraceHeader GetTraceHeader() { } public void SetExtra(string key, object? value) { } + public void SetMeasurement(string name, Sentry.Protocol.Measurement measurement) { } public void SetTag(string key, string value) { } public Sentry.ISpan StartChild(string operation) { } public void UnsetTag(string key) { } @@ -1034,7 +1032,7 @@ namespace Sentry public TracePropagationTarget(System.Text.RegularExpressions.Regex regex) { } public TracePropagationTarget(string substringOrRegexPattern, System.StringComparison comparison = 5) { } } - public class Transaction : Sentry.IEventLike, Sentry.IHasBreadcrumbs, Sentry.IHasExtra, Sentry.IHasTags, Sentry.IHasTransactionNameSource, Sentry.IJsonSerializable, Sentry.ISpanContext, Sentry.ISpanData, Sentry.ITransactionContext, Sentry.ITransactionData, Sentry.Protocol.ITraceContext + public class Transaction : Sentry.IEventLike, Sentry.IHasExtra, Sentry.IHasTags, Sentry.IJsonSerializable, Sentry.ISpanData, Sentry.ITransactionContext, Sentry.ITransactionData, Sentry.Protocol.ITraceContext { public Transaction(Sentry.ITransaction tracer) { } public Transaction(string name, string operation) { } @@ -1078,7 +1076,7 @@ namespace Sentry public void WriteTo(System.Text.Json.Utf8JsonWriter writer, Sentry.Extensibility.IDiagnosticLogger? logger) { } public static Sentry.Transaction FromJson(System.Text.Json.JsonElement json) { } } - public class TransactionContext : Sentry.SpanContext, Sentry.IHasTransactionNameSource, Sentry.ISpanContext, Sentry.ITransactionContext, Sentry.Protocol.ITraceContext + public class TransactionContext : Sentry.SpanContext, Sentry.ITransactionContext, Sentry.Protocol.ITraceContext { public TransactionContext(string name, string operation) { } public TransactionContext(string name, string operation, Sentry.SentryTraceHeader traceHeader) { } @@ -1107,11 +1105,9 @@ namespace Sentry public System.Collections.Generic.IReadOnlyDictionary CustomSamplingContext { get; } public Sentry.ITransactionContext TransactionContext { get; } } - public class TransactionTracer : Sentry.IEventLike, Sentry.IHasBreadcrumbs, Sentry.IHasExtra, Sentry.IHasTags, Sentry.IHasTransactionNameSource, Sentry.ISpan, Sentry.ISpanContext, Sentry.ISpanData, Sentry.ITransaction, Sentry.ITransactionContext, Sentry.ITransactionData, Sentry.Protocol.ITraceContext + public class TransactionTracer : Sentry.IEventLike, Sentry.IHasExtra, Sentry.IHasTags, Sentry.ISpan, Sentry.ISpanData, Sentry.ITransaction, Sentry.ITransactionContext, Sentry.ITransactionData, Sentry.Protocol.ITraceContext { public TransactionTracer(Sentry.IHub hub, Sentry.ITransactionContext context) { } - public TransactionTracer(Sentry.IHub hub, string name, string operation) { } - public TransactionTracer(Sentry.IHub hub, string name, string operation, Sentry.TransactionNameSource nameSource) { } public System.Collections.Generic.IReadOnlyCollection Breadcrumbs { get; } public Sentry.Contexts Contexts { get; set; } public string? Description { get; set; } diff --git a/test/Sentry.Tests/ApiApprovalTests.Run.DotNet6_0.verified.txt b/test/Sentry.Tests/ApiApprovalTests.Run.DotNet6_0.verified.txt index 7c2dc23b39..acc214cae3 100644 --- a/test/Sentry.Tests/ApiApprovalTests.Run.DotNet6_0.verified.txt +++ b/test/Sentry.Tests/ApiApprovalTests.Run.DotNet6_0.verified.txt @@ -118,6 +118,9 @@ namespace Sentry } public static class EventLikeExtensions { + public static void AddBreadcrumb(this Sentry.IEventLike eventLike, string message, string? category, string? type, System.ValueTuple? dataPair = default, Sentry.BreadcrumbLevel level = 0) { } + public static void AddBreadcrumb(this Sentry.IEventLike eventLike, string message, string? category = null, string? type = null, System.Collections.Generic.IReadOnlyDictionary? data = null, Sentry.BreadcrumbLevel level = 0) { } + public static void AddBreadcrumb(this Sentry.IEventLike eventLike, System.DateTimeOffset? timestamp, string message, string? category = null, string? type = null, System.Collections.Generic.IReadOnlyDictionary? data = null, Sentry.BreadcrumbLevel level = 0) { } public static bool HasUser(this Sentry.IEventLike eventLike) { } public static void SetFingerprint(this Sentry.IEventLike eventLike, System.Collections.Generic.IEnumerable fingerprint) { } public static void SetFingerprint(this Sentry.IEventLike eventLike, params string[] fingerprint) { } @@ -128,12 +131,6 @@ namespace Sentry public FileAttachmentContent(string filePath, bool readFileAsynchronously) { } public System.IO.Stream GetStream() { } } - public static class HasBreadcrumbsExtensions - { - public static void AddBreadcrumb(this Sentry.IHasBreadcrumbs hasBreadcrumbs, string message, string? category, string? type, System.ValueTuple? dataPair = default, Sentry.BreadcrumbLevel level = 0) { } - public static void AddBreadcrumb(this Sentry.IHasBreadcrumbs hasBreadcrumbs, string message, string? category = null, string? type = null, System.Collections.Generic.IReadOnlyDictionary? data = null, Sentry.BreadcrumbLevel level = 0) { } - public static void AddBreadcrumb(this Sentry.IHasBreadcrumbs hasBreadcrumbs, System.DateTimeOffset? timestamp, string message, string? category = null, string? type = null, System.Collections.Generic.IReadOnlyDictionary? data = null, Sentry.BreadcrumbLevel level = 0) { } - } public static class HasExtraExtensions { public static void SetExtras(this Sentry.IHasExtra hasExtra, System.Collections.Generic.IEnumerable> values) { } @@ -192,22 +189,19 @@ namespace Sentry { System.IO.Stream GetStream(); } - public interface IEventLike : Sentry.IHasBreadcrumbs, Sentry.IHasExtra, Sentry.IHasTags + public interface IEventLike : Sentry.IHasExtra, Sentry.IHasTags { + System.Collections.Generic.IReadOnlyCollection Breadcrumbs { get; } Sentry.Contexts Contexts { get; set; } + string? Distribution { get; set; } string? Environment { get; set; } System.Collections.Generic.IReadOnlyList Fingerprint { get; set; } Sentry.SentryLevel? Level { get; set; } - string? Platform { get; set; } string? Release { get; set; } Sentry.Request Request { get; set; } Sentry.SdkVersion Sdk { get; } string? TransactionName { get; set; } Sentry.User User { get; set; } - } - public interface IHasBreadcrumbs - { - System.Collections.Generic.IReadOnlyCollection Breadcrumbs { get; } void AddBreadcrumb(Sentry.Breadcrumb breadcrumb); } public interface IHasExtra @@ -221,10 +215,6 @@ namespace Sentry void SetTag(string key, string value); void UnsetTag(string key); } - public interface IHasTransactionNameSource - { - Sentry.TransactionNameSource NameSource { get; } - } public interface IHub : Sentry.ISentryClient, Sentry.ISentryScopeManager { Sentry.SentryId LastEventId { get; } @@ -290,7 +280,7 @@ namespace Sentry System.DateTimeOffset StartTimestamp { get; } string? UserAgent { get; } } - public interface ISpan : Sentry.IHasExtra, Sentry.IHasTags, Sentry.ISpanContext, Sentry.ISpanData, Sentry.Protocol.ITraceContext + public interface ISpan : Sentry.IHasExtra, Sentry.IHasTags, Sentry.ISpanData, Sentry.Protocol.ITraceContext { new string? Description { get; set; } new string Operation { get; set; } @@ -301,27 +291,32 @@ namespace Sentry void Finish(System.Exception exception, Sentry.SpanStatus status); Sentry.ISpan StartChild(string operation); } - public interface ISpanContext : Sentry.Protocol.ITraceContext { } - public interface ISpanData : Sentry.IHasExtra, Sentry.IHasTags, Sentry.ISpanContext, Sentry.Protocol.ITraceContext + public interface ISpanData : Sentry.IHasExtra, Sentry.IHasTags, Sentry.Protocol.ITraceContext { System.DateTimeOffset? EndTimestamp { get; } bool IsFinished { get; } + System.Collections.Generic.IReadOnlyDictionary Measurements { get; } System.DateTimeOffset StartTimestamp { get; } Sentry.SentryTraceHeader GetTraceHeader(); + void SetMeasurement(string name, Sentry.Protocol.Measurement measurement); } - public interface ITransaction : Sentry.IEventLike, Sentry.IHasBreadcrumbs, Sentry.IHasExtra, Sentry.IHasTags, Sentry.ISpan, Sentry.ISpanContext, Sentry.ISpanData, Sentry.ITransactionContext, Sentry.ITransactionData, Sentry.Protocol.ITraceContext + public interface ITransaction : Sentry.IEventLike, Sentry.IHasExtra, Sentry.IHasTags, Sentry.ISpan, Sentry.ISpanData, Sentry.ITransactionContext, Sentry.ITransactionData, Sentry.Protocol.ITraceContext { new bool? IsParentSampled { get; set; } new string Name { get; set; } System.Collections.Generic.IReadOnlyCollection Spans { get; } Sentry.ISpan? GetLastActiveSpan(); } - public interface ITransactionContext : Sentry.ISpanContext, Sentry.Protocol.ITraceContext + public interface ITransactionContext : Sentry.Protocol.ITraceContext { bool? IsParentSampled { get; } string Name { get; } + Sentry.TransactionNameSource NameSource { get; } + } + public interface ITransactionData : Sentry.IEventLike, Sentry.IHasExtra, Sentry.IHasTags, Sentry.ISpanData, Sentry.ITransactionContext, Sentry.Protocol.ITraceContext + { + string? Platform { get; set; } } - public interface ITransactionData : Sentry.IEventLike, Sentry.IHasBreadcrumbs, Sentry.IHasExtra, Sentry.IHasTags, Sentry.ISpanContext, Sentry.ISpanData, Sentry.ITransactionContext, Sentry.Protocol.ITraceContext { } public enum InstructionAddressAdjustment { Auto = 0, @@ -334,14 +329,6 @@ namespace Sentry Sentry = 0, OpenTelemetry = 1, } - public static class MeasurementExtensions - { - public static void SetMeasurement(this Sentry.ITransactionData transaction, string name, double value, Sentry.MeasurementUnit unit = default) { } - public static void SetMeasurement(this Sentry.ITransactionData transaction, string name, int value, Sentry.MeasurementUnit unit = default) { } - public static void SetMeasurement(this Sentry.ITransactionData transaction, string name, long value, Sentry.MeasurementUnit unit = default) { } - [System.CLSCompliant(false)] - public static void SetMeasurement(this Sentry.ITransactionData transaction, string name, ulong value, Sentry.MeasurementUnit unit = default) { } - } public readonly struct MeasurementUnit : System.IEquatable { public static Sentry.MeasurementUnit None; @@ -421,7 +408,7 @@ namespace Sentry public void WriteTo(System.Text.Json.Utf8JsonWriter writer, Sentry.Extensibility.IDiagnosticLogger? logger) { } public static Sentry.Request FromJson(System.Text.Json.JsonElement json) { } } - public class Scope : Sentry.IEventLike, Sentry.IHasBreadcrumbs, Sentry.IHasExtra, Sentry.IHasTags + public class Scope : Sentry.IEventLike, Sentry.IHasExtra, Sentry.IHasTags { public Scope(Sentry.SentryOptions? options) { } public System.Collections.Generic.IReadOnlyCollection Attachments { get; } @@ -432,7 +419,6 @@ namespace Sentry public System.Collections.Generic.IReadOnlyDictionary Extra { get; } public System.Collections.Generic.IReadOnlyList Fingerprint { get; set; } public Sentry.SentryLevel? Level { get; set; } - public string? Platform { get; set; } public string? Release { get; set; } public Sentry.Request Request { get; set; } public Sentry.SdkVersion Sdk { get; } @@ -510,7 +496,7 @@ namespace Sentry public static System.Threading.Tasks.Task FlushAsync(this Sentry.ISentryClient client) { } } [System.Diagnostics.DebuggerDisplay("{GetType().Name,nq}: {EventId,nq}")] - public sealed class SentryEvent : Sentry.IEventLike, Sentry.IHasBreadcrumbs, Sentry.IHasExtra, Sentry.IHasTags, Sentry.IJsonSerializable + public sealed class SentryEvent : Sentry.IEventLike, Sentry.IHasExtra, Sentry.IHasTags, Sentry.IJsonSerializable { public SentryEvent() { } public SentryEvent(System.Exception? exception) { } @@ -811,7 +797,7 @@ namespace Sentry public System.Collections.Generic.IList FramesOmitted { get; } public string? Function { get; set; } public long? FunctionId { get; set; } - public long? ImageAddress { get; set; } + public long? ImageAddress { get; set; } public bool? InApp { get; set; } public long? InstructionAddress { get; set; } public int? LineNumber { get; set; } @@ -901,7 +887,7 @@ namespace Sentry public void WriteTo(System.Text.Json.Utf8JsonWriter writer, Sentry.Extensibility.IDiagnosticLogger? logger) { } public static Sentry.SessionUpdate FromJson(System.Text.Json.JsonElement json) { } } - public class Span : Sentry.IHasExtra, Sentry.IHasTags, Sentry.IJsonSerializable, Sentry.ISpanContext, Sentry.ISpanData, Sentry.Protocol.ITraceContext + public class Span : Sentry.IHasExtra, Sentry.IHasTags, Sentry.IJsonSerializable, Sentry.ISpanData, Sentry.Protocol.ITraceContext { public Span(Sentry.ISpan tracer) { } public Span(Sentry.SpanId? parentSpanId, string operation) { } @@ -910,6 +896,7 @@ namespace Sentry public System.Collections.Generic.IReadOnlyDictionary Extra { get; } public bool IsFinished { get; } public bool? IsSampled { get; } + public System.Collections.Generic.IReadOnlyDictionary Measurements { get; } public string Operation { get; set; } public Sentry.SpanId? ParentSpanId { get; } public Sentry.SpanId SpanId { get; } @@ -919,12 +906,13 @@ namespace Sentry public Sentry.SentryId TraceId { get; } public Sentry.SentryTraceHeader GetTraceHeader() { } public void SetExtra(string key, object? value) { } + public void SetMeasurement(string name, Sentry.Protocol.Measurement measurement) { } public void SetTag(string key, string value) { } public void UnsetTag(string key) { } public void WriteTo(System.Text.Json.Utf8JsonWriter writer, Sentry.Extensibility.IDiagnosticLogger? logger) { } public static Sentry.Span FromJson(System.Text.Json.JsonElement json) { } } - public class SpanContext : Sentry.ISpanContext, Sentry.Protocol.ITraceContext + public class SpanContext : Sentry.Protocol.ITraceContext { public SpanContext(Sentry.SpanId spanId, Sentry.SpanId? parentSpanId, Sentry.SentryId traceId, string operation, string? description, Sentry.SpanStatus? status, bool? isSampled) { } public string? Description { get; } @@ -936,6 +924,14 @@ namespace Sentry public Sentry.SpanStatus? Status { get; } public Sentry.SentryId TraceId { get; } } + public static class SpanDataExtensions + { + public static void SetMeasurement(this Sentry.ISpanData spanData, string name, double value, Sentry.MeasurementUnit unit = default) { } + public static void SetMeasurement(this Sentry.ISpanData spanData, string name, int value, Sentry.MeasurementUnit unit = default) { } + public static void SetMeasurement(this Sentry.ISpanData spanData, string name, long value, Sentry.MeasurementUnit unit = default) { } + [System.CLSCompliant(false)] + public static void SetMeasurement(this Sentry.ISpanData spanData, string name, ulong value, Sentry.MeasurementUnit unit = default) { } + } public static class SpanExtensions { public static Sentry.ITransaction GetTransaction(this Sentry.ISpan span) { } @@ -978,7 +974,7 @@ namespace Sentry OutOfRange = 15, DataLoss = 16, } - public class SpanTracer : Sentry.IHasExtra, Sentry.IHasTags, Sentry.ISpan, Sentry.ISpanContext, Sentry.ISpanData, Sentry.Protocol.ITraceContext + public class SpanTracer : Sentry.IHasExtra, Sentry.IHasTags, Sentry.ISpan, Sentry.ISpanData, Sentry.Protocol.ITraceContext { public SpanTracer(Sentry.IHub hub, Sentry.TransactionTracer transaction, Sentry.SpanId? parentSpanId, Sentry.SentryId traceId, string operation) { } public string? Description { get; set; } @@ -986,6 +982,7 @@ namespace Sentry public System.Collections.Generic.IReadOnlyDictionary Extra { get; } public bool IsFinished { get; } public bool? IsSampled { get; } + public System.Collections.Generic.IReadOnlyDictionary Measurements { get; } public string Operation { get; set; } public Sentry.SpanId? ParentSpanId { get; } public Sentry.SpanId SpanId { get; } @@ -999,6 +996,7 @@ namespace Sentry public void Finish(System.Exception exception, Sentry.SpanStatus status) { } public Sentry.SentryTraceHeader GetTraceHeader() { } public void SetExtra(string key, object? value) { } + public void SetMeasurement(string name, Sentry.Protocol.Measurement measurement) { } public void SetTag(string key, string value) { } public Sentry.ISpan StartChild(string operation) { } public void UnsetTag(string key) { } @@ -1035,7 +1033,7 @@ namespace Sentry public TracePropagationTarget(System.Text.RegularExpressions.Regex regex) { } public TracePropagationTarget(string substringOrRegexPattern, System.StringComparison comparison = 5) { } } - public class Transaction : Sentry.IEventLike, Sentry.IHasBreadcrumbs, Sentry.IHasExtra, Sentry.IHasTags, Sentry.IHasTransactionNameSource, Sentry.IJsonSerializable, Sentry.ISpanContext, Sentry.ISpanData, Sentry.ITransactionContext, Sentry.ITransactionData, Sentry.Protocol.ITraceContext + public class Transaction : Sentry.IEventLike, Sentry.IHasExtra, Sentry.IHasTags, Sentry.IJsonSerializable, Sentry.ISpanData, Sentry.ITransactionContext, Sentry.ITransactionData, Sentry.Protocol.ITraceContext { public Transaction(Sentry.ITransaction tracer) { } public Transaction(string name, string operation) { } @@ -1079,7 +1077,7 @@ namespace Sentry public void WriteTo(System.Text.Json.Utf8JsonWriter writer, Sentry.Extensibility.IDiagnosticLogger? logger) { } public static Sentry.Transaction FromJson(System.Text.Json.JsonElement json) { } } - public class TransactionContext : Sentry.SpanContext, Sentry.IHasTransactionNameSource, Sentry.ISpanContext, Sentry.ITransactionContext, Sentry.Protocol.ITraceContext + public class TransactionContext : Sentry.SpanContext, Sentry.ITransactionContext, Sentry.Protocol.ITraceContext { public TransactionContext(string name, string operation) { } public TransactionContext(string name, string operation, Sentry.SentryTraceHeader traceHeader) { } @@ -1108,11 +1106,9 @@ namespace Sentry public System.Collections.Generic.IReadOnlyDictionary CustomSamplingContext { get; } public Sentry.ITransactionContext TransactionContext { get; } } - public class TransactionTracer : Sentry.IEventLike, Sentry.IHasBreadcrumbs, Sentry.IHasExtra, Sentry.IHasTags, Sentry.IHasTransactionNameSource, Sentry.ISpan, Sentry.ISpanContext, Sentry.ISpanData, Sentry.ITransaction, Sentry.ITransactionContext, Sentry.ITransactionData, Sentry.Protocol.ITraceContext + public class TransactionTracer : Sentry.IEventLike, Sentry.IHasExtra, Sentry.IHasTags, Sentry.ISpan, Sentry.ISpanData, Sentry.ITransaction, Sentry.ITransactionContext, Sentry.ITransactionData, Sentry.Protocol.ITraceContext { public TransactionTracer(Sentry.IHub hub, Sentry.ITransactionContext context) { } - public TransactionTracer(Sentry.IHub hub, string name, string operation) { } - public TransactionTracer(Sentry.IHub hub, string name, string operation, Sentry.TransactionNameSource nameSource) { } public System.Collections.Generic.IReadOnlyCollection Breadcrumbs { get; } public Sentry.Contexts Contexts { get; set; } public string? Description { get; set; } diff --git a/test/Sentry.Tests/ApiApprovalTests.Run.DotNet7_0.verified.txt b/test/Sentry.Tests/ApiApprovalTests.Run.DotNet7_0.verified.txt index 7c2dc23b39..acc214cae3 100644 --- a/test/Sentry.Tests/ApiApprovalTests.Run.DotNet7_0.verified.txt +++ b/test/Sentry.Tests/ApiApprovalTests.Run.DotNet7_0.verified.txt @@ -118,6 +118,9 @@ namespace Sentry } public static class EventLikeExtensions { + public static void AddBreadcrumb(this Sentry.IEventLike eventLike, string message, string? category, string? type, System.ValueTuple? dataPair = default, Sentry.BreadcrumbLevel level = 0) { } + public static void AddBreadcrumb(this Sentry.IEventLike eventLike, string message, string? category = null, string? type = null, System.Collections.Generic.IReadOnlyDictionary? data = null, Sentry.BreadcrumbLevel level = 0) { } + public static void AddBreadcrumb(this Sentry.IEventLike eventLike, System.DateTimeOffset? timestamp, string message, string? category = null, string? type = null, System.Collections.Generic.IReadOnlyDictionary? data = null, Sentry.BreadcrumbLevel level = 0) { } public static bool HasUser(this Sentry.IEventLike eventLike) { } public static void SetFingerprint(this Sentry.IEventLike eventLike, System.Collections.Generic.IEnumerable fingerprint) { } public static void SetFingerprint(this Sentry.IEventLike eventLike, params string[] fingerprint) { } @@ -128,12 +131,6 @@ namespace Sentry public FileAttachmentContent(string filePath, bool readFileAsynchronously) { } public System.IO.Stream GetStream() { } } - public static class HasBreadcrumbsExtensions - { - public static void AddBreadcrumb(this Sentry.IHasBreadcrumbs hasBreadcrumbs, string message, string? category, string? type, System.ValueTuple? dataPair = default, Sentry.BreadcrumbLevel level = 0) { } - public static void AddBreadcrumb(this Sentry.IHasBreadcrumbs hasBreadcrumbs, string message, string? category = null, string? type = null, System.Collections.Generic.IReadOnlyDictionary? data = null, Sentry.BreadcrumbLevel level = 0) { } - public static void AddBreadcrumb(this Sentry.IHasBreadcrumbs hasBreadcrumbs, System.DateTimeOffset? timestamp, string message, string? category = null, string? type = null, System.Collections.Generic.IReadOnlyDictionary? data = null, Sentry.BreadcrumbLevel level = 0) { } - } public static class HasExtraExtensions { public static void SetExtras(this Sentry.IHasExtra hasExtra, System.Collections.Generic.IEnumerable> values) { } @@ -192,22 +189,19 @@ namespace Sentry { System.IO.Stream GetStream(); } - public interface IEventLike : Sentry.IHasBreadcrumbs, Sentry.IHasExtra, Sentry.IHasTags + public interface IEventLike : Sentry.IHasExtra, Sentry.IHasTags { + System.Collections.Generic.IReadOnlyCollection Breadcrumbs { get; } Sentry.Contexts Contexts { get; set; } + string? Distribution { get; set; } string? Environment { get; set; } System.Collections.Generic.IReadOnlyList Fingerprint { get; set; } Sentry.SentryLevel? Level { get; set; } - string? Platform { get; set; } string? Release { get; set; } Sentry.Request Request { get; set; } Sentry.SdkVersion Sdk { get; } string? TransactionName { get; set; } Sentry.User User { get; set; } - } - public interface IHasBreadcrumbs - { - System.Collections.Generic.IReadOnlyCollection Breadcrumbs { get; } void AddBreadcrumb(Sentry.Breadcrumb breadcrumb); } public interface IHasExtra @@ -221,10 +215,6 @@ namespace Sentry void SetTag(string key, string value); void UnsetTag(string key); } - public interface IHasTransactionNameSource - { - Sentry.TransactionNameSource NameSource { get; } - } public interface IHub : Sentry.ISentryClient, Sentry.ISentryScopeManager { Sentry.SentryId LastEventId { get; } @@ -290,7 +280,7 @@ namespace Sentry System.DateTimeOffset StartTimestamp { get; } string? UserAgent { get; } } - public interface ISpan : Sentry.IHasExtra, Sentry.IHasTags, Sentry.ISpanContext, Sentry.ISpanData, Sentry.Protocol.ITraceContext + public interface ISpan : Sentry.IHasExtra, Sentry.IHasTags, Sentry.ISpanData, Sentry.Protocol.ITraceContext { new string? Description { get; set; } new string Operation { get; set; } @@ -301,27 +291,32 @@ namespace Sentry void Finish(System.Exception exception, Sentry.SpanStatus status); Sentry.ISpan StartChild(string operation); } - public interface ISpanContext : Sentry.Protocol.ITraceContext { } - public interface ISpanData : Sentry.IHasExtra, Sentry.IHasTags, Sentry.ISpanContext, Sentry.Protocol.ITraceContext + public interface ISpanData : Sentry.IHasExtra, Sentry.IHasTags, Sentry.Protocol.ITraceContext { System.DateTimeOffset? EndTimestamp { get; } bool IsFinished { get; } + System.Collections.Generic.IReadOnlyDictionary Measurements { get; } System.DateTimeOffset StartTimestamp { get; } Sentry.SentryTraceHeader GetTraceHeader(); + void SetMeasurement(string name, Sentry.Protocol.Measurement measurement); } - public interface ITransaction : Sentry.IEventLike, Sentry.IHasBreadcrumbs, Sentry.IHasExtra, Sentry.IHasTags, Sentry.ISpan, Sentry.ISpanContext, Sentry.ISpanData, Sentry.ITransactionContext, Sentry.ITransactionData, Sentry.Protocol.ITraceContext + public interface ITransaction : Sentry.IEventLike, Sentry.IHasExtra, Sentry.IHasTags, Sentry.ISpan, Sentry.ISpanData, Sentry.ITransactionContext, Sentry.ITransactionData, Sentry.Protocol.ITraceContext { new bool? IsParentSampled { get; set; } new string Name { get; set; } System.Collections.Generic.IReadOnlyCollection Spans { get; } Sentry.ISpan? GetLastActiveSpan(); } - public interface ITransactionContext : Sentry.ISpanContext, Sentry.Protocol.ITraceContext + public interface ITransactionContext : Sentry.Protocol.ITraceContext { bool? IsParentSampled { get; } string Name { get; } + Sentry.TransactionNameSource NameSource { get; } + } + public interface ITransactionData : Sentry.IEventLike, Sentry.IHasExtra, Sentry.IHasTags, Sentry.ISpanData, Sentry.ITransactionContext, Sentry.Protocol.ITraceContext + { + string? Platform { get; set; } } - public interface ITransactionData : Sentry.IEventLike, Sentry.IHasBreadcrumbs, Sentry.IHasExtra, Sentry.IHasTags, Sentry.ISpanContext, Sentry.ISpanData, Sentry.ITransactionContext, Sentry.Protocol.ITraceContext { } public enum InstructionAddressAdjustment { Auto = 0, @@ -334,14 +329,6 @@ namespace Sentry Sentry = 0, OpenTelemetry = 1, } - public static class MeasurementExtensions - { - public static void SetMeasurement(this Sentry.ITransactionData transaction, string name, double value, Sentry.MeasurementUnit unit = default) { } - public static void SetMeasurement(this Sentry.ITransactionData transaction, string name, int value, Sentry.MeasurementUnit unit = default) { } - public static void SetMeasurement(this Sentry.ITransactionData transaction, string name, long value, Sentry.MeasurementUnit unit = default) { } - [System.CLSCompliant(false)] - public static void SetMeasurement(this Sentry.ITransactionData transaction, string name, ulong value, Sentry.MeasurementUnit unit = default) { } - } public readonly struct MeasurementUnit : System.IEquatable { public static Sentry.MeasurementUnit None; @@ -421,7 +408,7 @@ namespace Sentry public void WriteTo(System.Text.Json.Utf8JsonWriter writer, Sentry.Extensibility.IDiagnosticLogger? logger) { } public static Sentry.Request FromJson(System.Text.Json.JsonElement json) { } } - public class Scope : Sentry.IEventLike, Sentry.IHasBreadcrumbs, Sentry.IHasExtra, Sentry.IHasTags + public class Scope : Sentry.IEventLike, Sentry.IHasExtra, Sentry.IHasTags { public Scope(Sentry.SentryOptions? options) { } public System.Collections.Generic.IReadOnlyCollection Attachments { get; } @@ -432,7 +419,6 @@ namespace Sentry public System.Collections.Generic.IReadOnlyDictionary Extra { get; } public System.Collections.Generic.IReadOnlyList Fingerprint { get; set; } public Sentry.SentryLevel? Level { get; set; } - public string? Platform { get; set; } public string? Release { get; set; } public Sentry.Request Request { get; set; } public Sentry.SdkVersion Sdk { get; } @@ -510,7 +496,7 @@ namespace Sentry public static System.Threading.Tasks.Task FlushAsync(this Sentry.ISentryClient client) { } } [System.Diagnostics.DebuggerDisplay("{GetType().Name,nq}: {EventId,nq}")] - public sealed class SentryEvent : Sentry.IEventLike, Sentry.IHasBreadcrumbs, Sentry.IHasExtra, Sentry.IHasTags, Sentry.IJsonSerializable + public sealed class SentryEvent : Sentry.IEventLike, Sentry.IHasExtra, Sentry.IHasTags, Sentry.IJsonSerializable { public SentryEvent() { } public SentryEvent(System.Exception? exception) { } @@ -811,7 +797,7 @@ namespace Sentry public System.Collections.Generic.IList FramesOmitted { get; } public string? Function { get; set; } public long? FunctionId { get; set; } - public long? ImageAddress { get; set; } + public long? ImageAddress { get; set; } public bool? InApp { get; set; } public long? InstructionAddress { get; set; } public int? LineNumber { get; set; } @@ -901,7 +887,7 @@ namespace Sentry public void WriteTo(System.Text.Json.Utf8JsonWriter writer, Sentry.Extensibility.IDiagnosticLogger? logger) { } public static Sentry.SessionUpdate FromJson(System.Text.Json.JsonElement json) { } } - public class Span : Sentry.IHasExtra, Sentry.IHasTags, Sentry.IJsonSerializable, Sentry.ISpanContext, Sentry.ISpanData, Sentry.Protocol.ITraceContext + public class Span : Sentry.IHasExtra, Sentry.IHasTags, Sentry.IJsonSerializable, Sentry.ISpanData, Sentry.Protocol.ITraceContext { public Span(Sentry.ISpan tracer) { } public Span(Sentry.SpanId? parentSpanId, string operation) { } @@ -910,6 +896,7 @@ namespace Sentry public System.Collections.Generic.IReadOnlyDictionary Extra { get; } public bool IsFinished { get; } public bool? IsSampled { get; } + public System.Collections.Generic.IReadOnlyDictionary Measurements { get; } public string Operation { get; set; } public Sentry.SpanId? ParentSpanId { get; } public Sentry.SpanId SpanId { get; } @@ -919,12 +906,13 @@ namespace Sentry public Sentry.SentryId TraceId { get; } public Sentry.SentryTraceHeader GetTraceHeader() { } public void SetExtra(string key, object? value) { } + public void SetMeasurement(string name, Sentry.Protocol.Measurement measurement) { } public void SetTag(string key, string value) { } public void UnsetTag(string key) { } public void WriteTo(System.Text.Json.Utf8JsonWriter writer, Sentry.Extensibility.IDiagnosticLogger? logger) { } public static Sentry.Span FromJson(System.Text.Json.JsonElement json) { } } - public class SpanContext : Sentry.ISpanContext, Sentry.Protocol.ITraceContext + public class SpanContext : Sentry.Protocol.ITraceContext { public SpanContext(Sentry.SpanId spanId, Sentry.SpanId? parentSpanId, Sentry.SentryId traceId, string operation, string? description, Sentry.SpanStatus? status, bool? isSampled) { } public string? Description { get; } @@ -936,6 +924,14 @@ namespace Sentry public Sentry.SpanStatus? Status { get; } public Sentry.SentryId TraceId { get; } } + public static class SpanDataExtensions + { + public static void SetMeasurement(this Sentry.ISpanData spanData, string name, double value, Sentry.MeasurementUnit unit = default) { } + public static void SetMeasurement(this Sentry.ISpanData spanData, string name, int value, Sentry.MeasurementUnit unit = default) { } + public static void SetMeasurement(this Sentry.ISpanData spanData, string name, long value, Sentry.MeasurementUnit unit = default) { } + [System.CLSCompliant(false)] + public static void SetMeasurement(this Sentry.ISpanData spanData, string name, ulong value, Sentry.MeasurementUnit unit = default) { } + } public static class SpanExtensions { public static Sentry.ITransaction GetTransaction(this Sentry.ISpan span) { } @@ -978,7 +974,7 @@ namespace Sentry OutOfRange = 15, DataLoss = 16, } - public class SpanTracer : Sentry.IHasExtra, Sentry.IHasTags, Sentry.ISpan, Sentry.ISpanContext, Sentry.ISpanData, Sentry.Protocol.ITraceContext + public class SpanTracer : Sentry.IHasExtra, Sentry.IHasTags, Sentry.ISpan, Sentry.ISpanData, Sentry.Protocol.ITraceContext { public SpanTracer(Sentry.IHub hub, Sentry.TransactionTracer transaction, Sentry.SpanId? parentSpanId, Sentry.SentryId traceId, string operation) { } public string? Description { get; set; } @@ -986,6 +982,7 @@ namespace Sentry public System.Collections.Generic.IReadOnlyDictionary Extra { get; } public bool IsFinished { get; } public bool? IsSampled { get; } + public System.Collections.Generic.IReadOnlyDictionary Measurements { get; } public string Operation { get; set; } public Sentry.SpanId? ParentSpanId { get; } public Sentry.SpanId SpanId { get; } @@ -999,6 +996,7 @@ namespace Sentry public void Finish(System.Exception exception, Sentry.SpanStatus status) { } public Sentry.SentryTraceHeader GetTraceHeader() { } public void SetExtra(string key, object? value) { } + public void SetMeasurement(string name, Sentry.Protocol.Measurement measurement) { } public void SetTag(string key, string value) { } public Sentry.ISpan StartChild(string operation) { } public void UnsetTag(string key) { } @@ -1035,7 +1033,7 @@ namespace Sentry public TracePropagationTarget(System.Text.RegularExpressions.Regex regex) { } public TracePropagationTarget(string substringOrRegexPattern, System.StringComparison comparison = 5) { } } - public class Transaction : Sentry.IEventLike, Sentry.IHasBreadcrumbs, Sentry.IHasExtra, Sentry.IHasTags, Sentry.IHasTransactionNameSource, Sentry.IJsonSerializable, Sentry.ISpanContext, Sentry.ISpanData, Sentry.ITransactionContext, Sentry.ITransactionData, Sentry.Protocol.ITraceContext + public class Transaction : Sentry.IEventLike, Sentry.IHasExtra, Sentry.IHasTags, Sentry.IJsonSerializable, Sentry.ISpanData, Sentry.ITransactionContext, Sentry.ITransactionData, Sentry.Protocol.ITraceContext { public Transaction(Sentry.ITransaction tracer) { } public Transaction(string name, string operation) { } @@ -1079,7 +1077,7 @@ namespace Sentry public void WriteTo(System.Text.Json.Utf8JsonWriter writer, Sentry.Extensibility.IDiagnosticLogger? logger) { } public static Sentry.Transaction FromJson(System.Text.Json.JsonElement json) { } } - public class TransactionContext : Sentry.SpanContext, Sentry.IHasTransactionNameSource, Sentry.ISpanContext, Sentry.ITransactionContext, Sentry.Protocol.ITraceContext + public class TransactionContext : Sentry.SpanContext, Sentry.ITransactionContext, Sentry.Protocol.ITraceContext { public TransactionContext(string name, string operation) { } public TransactionContext(string name, string operation, Sentry.SentryTraceHeader traceHeader) { } @@ -1108,11 +1106,9 @@ namespace Sentry public System.Collections.Generic.IReadOnlyDictionary CustomSamplingContext { get; } public Sentry.ITransactionContext TransactionContext { get; } } - public class TransactionTracer : Sentry.IEventLike, Sentry.IHasBreadcrumbs, Sentry.IHasExtra, Sentry.IHasTags, Sentry.IHasTransactionNameSource, Sentry.ISpan, Sentry.ISpanContext, Sentry.ISpanData, Sentry.ITransaction, Sentry.ITransactionContext, Sentry.ITransactionData, Sentry.Protocol.ITraceContext + public class TransactionTracer : Sentry.IEventLike, Sentry.IHasExtra, Sentry.IHasTags, Sentry.ISpan, Sentry.ISpanData, Sentry.ITransaction, Sentry.ITransactionContext, Sentry.ITransactionData, Sentry.Protocol.ITraceContext { public TransactionTracer(Sentry.IHub hub, Sentry.ITransactionContext context) { } - public TransactionTracer(Sentry.IHub hub, string name, string operation) { } - public TransactionTracer(Sentry.IHub hub, string name, string operation, Sentry.TransactionNameSource nameSource) { } public System.Collections.Generic.IReadOnlyCollection Breadcrumbs { get; } public Sentry.Contexts Contexts { get; set; } public string? Description { get; set; } diff --git a/test/Sentry.Tests/ApiApprovalTests.Run.Net4_8.verified.txt b/test/Sentry.Tests/ApiApprovalTests.Run.Net4_8.verified.txt index 1ff0447115..f98322fea0 100644 --- a/test/Sentry.Tests/ApiApprovalTests.Run.Net4_8.verified.txt +++ b/test/Sentry.Tests/ApiApprovalTests.Run.Net4_8.verified.txt @@ -118,6 +118,8 @@ namespace Sentry } public static class EventLikeExtensions { + public static void AddBreadcrumb(this Sentry.IEventLike eventLike, string message, string? category = null, string? type = null, System.Collections.Generic.IReadOnlyDictionary? data = null, Sentry.BreadcrumbLevel level = 0) { } + public static void AddBreadcrumb(this Sentry.IEventLike eventLike, System.DateTimeOffset? timestamp, string message, string? category = null, string? type = null, System.Collections.Generic.IReadOnlyDictionary? data = null, Sentry.BreadcrumbLevel level = 0) { } public static bool HasUser(this Sentry.IEventLike eventLike) { } public static void SetFingerprint(this Sentry.IEventLike eventLike, System.Collections.Generic.IEnumerable fingerprint) { } public static void SetFingerprint(this Sentry.IEventLike eventLike, params string[] fingerprint) { } @@ -128,11 +130,6 @@ namespace Sentry public FileAttachmentContent(string filePath, bool readFileAsynchronously) { } public System.IO.Stream GetStream() { } } - public static class HasBreadcrumbsExtensions - { - public static void AddBreadcrumb(this Sentry.IHasBreadcrumbs hasBreadcrumbs, string message, string? category = null, string? type = null, System.Collections.Generic.IReadOnlyDictionary? data = null, Sentry.BreadcrumbLevel level = 0) { } - public static void AddBreadcrumb(this Sentry.IHasBreadcrumbs hasBreadcrumbs, System.DateTimeOffset? timestamp, string message, string? category = null, string? type = null, System.Collections.Generic.IReadOnlyDictionary? data = null, Sentry.BreadcrumbLevel level = 0) { } - } public static class HasExtraExtensions { public static void SetExtras(this Sentry.IHasExtra hasExtra, System.Collections.Generic.IEnumerable> values) { } @@ -191,22 +188,19 @@ namespace Sentry { System.IO.Stream GetStream(); } - public interface IEventLike : Sentry.IHasBreadcrumbs, Sentry.IHasExtra, Sentry.IHasTags + public interface IEventLike : Sentry.IHasExtra, Sentry.IHasTags { + System.Collections.Generic.IReadOnlyCollection Breadcrumbs { get; } Sentry.Contexts Contexts { get; set; } + string? Distribution { get; set; } string? Environment { get; set; } System.Collections.Generic.IReadOnlyList Fingerprint { get; set; } Sentry.SentryLevel? Level { get; set; } - string? Platform { get; set; } string? Release { get; set; } Sentry.Request Request { get; set; } Sentry.SdkVersion Sdk { get; } string? TransactionName { get; set; } Sentry.User User { get; set; } - } - public interface IHasBreadcrumbs - { - System.Collections.Generic.IReadOnlyCollection Breadcrumbs { get; } void AddBreadcrumb(Sentry.Breadcrumb breadcrumb); } public interface IHasExtra @@ -220,10 +214,6 @@ namespace Sentry void SetTag(string key, string value); void UnsetTag(string key); } - public interface IHasTransactionNameSource - { - Sentry.TransactionNameSource NameSource { get; } - } public interface IHub : Sentry.ISentryClient, Sentry.ISentryScopeManager { Sentry.SentryId LastEventId { get; } @@ -289,7 +279,7 @@ namespace Sentry System.DateTimeOffset StartTimestamp { get; } string? UserAgent { get; } } - public interface ISpan : Sentry.IHasExtra, Sentry.IHasTags, Sentry.ISpanContext, Sentry.ISpanData, Sentry.Protocol.ITraceContext + public interface ISpan : Sentry.IHasExtra, Sentry.IHasTags, Sentry.ISpanData, Sentry.Protocol.ITraceContext { new string? Description { get; set; } new string Operation { get; set; } @@ -300,27 +290,32 @@ namespace Sentry void Finish(System.Exception exception, Sentry.SpanStatus status); Sentry.ISpan StartChild(string operation); } - public interface ISpanContext : Sentry.Protocol.ITraceContext { } - public interface ISpanData : Sentry.IHasExtra, Sentry.IHasTags, Sentry.ISpanContext, Sentry.Protocol.ITraceContext + public interface ISpanData : Sentry.IHasExtra, Sentry.IHasTags, Sentry.Protocol.ITraceContext { System.DateTimeOffset? EndTimestamp { get; } bool IsFinished { get; } + System.Collections.Generic.IReadOnlyDictionary Measurements { get; } System.DateTimeOffset StartTimestamp { get; } Sentry.SentryTraceHeader GetTraceHeader(); + void SetMeasurement(string name, Sentry.Protocol.Measurement measurement); } - public interface ITransaction : Sentry.IEventLike, Sentry.IHasBreadcrumbs, Sentry.IHasExtra, Sentry.IHasTags, Sentry.ISpan, Sentry.ISpanContext, Sentry.ISpanData, Sentry.ITransactionContext, Sentry.ITransactionData, Sentry.Protocol.ITraceContext + public interface ITransaction : Sentry.IEventLike, Sentry.IHasExtra, Sentry.IHasTags, Sentry.ISpan, Sentry.ISpanData, Sentry.ITransactionContext, Sentry.ITransactionData, Sentry.Protocol.ITraceContext { new bool? IsParentSampled { get; set; } new string Name { get; set; } System.Collections.Generic.IReadOnlyCollection Spans { get; } Sentry.ISpan? GetLastActiveSpan(); } - public interface ITransactionContext : Sentry.ISpanContext, Sentry.Protocol.ITraceContext + public interface ITransactionContext : Sentry.Protocol.ITraceContext { bool? IsParentSampled { get; } string Name { get; } + Sentry.TransactionNameSource NameSource { get; } + } + public interface ITransactionData : Sentry.IEventLike, Sentry.IHasExtra, Sentry.IHasTags, Sentry.ISpanData, Sentry.ITransactionContext, Sentry.Protocol.ITraceContext + { + string? Platform { get; set; } } - public interface ITransactionData : Sentry.IEventLike, Sentry.IHasBreadcrumbs, Sentry.IHasExtra, Sentry.IHasTags, Sentry.ISpanContext, Sentry.ISpanData, Sentry.ITransactionContext, Sentry.Protocol.ITraceContext { } public enum InstructionAddressAdjustment { Auto = 0, @@ -333,14 +328,6 @@ namespace Sentry Sentry = 0, OpenTelemetry = 1, } - public static class MeasurementExtensions - { - public static void SetMeasurement(this Sentry.ITransactionData transaction, string name, double value, Sentry.MeasurementUnit unit = default) { } - public static void SetMeasurement(this Sentry.ITransactionData transaction, string name, int value, Sentry.MeasurementUnit unit = default) { } - public static void SetMeasurement(this Sentry.ITransactionData transaction, string name, long value, Sentry.MeasurementUnit unit = default) { } - [System.CLSCompliant(false)] - public static void SetMeasurement(this Sentry.ITransactionData transaction, string name, ulong value, Sentry.MeasurementUnit unit = default) { } - } public readonly struct MeasurementUnit : System.IEquatable { public static Sentry.MeasurementUnit None; @@ -420,7 +407,7 @@ namespace Sentry public void WriteTo(System.Text.Json.Utf8JsonWriter writer, Sentry.Extensibility.IDiagnosticLogger? logger) { } public static Sentry.Request FromJson(System.Text.Json.JsonElement json) { } } - public class Scope : Sentry.IEventLike, Sentry.IHasBreadcrumbs, Sentry.IHasExtra, Sentry.IHasTags + public class Scope : Sentry.IEventLike, Sentry.IHasExtra, Sentry.IHasTags { public Scope(Sentry.SentryOptions? options) { } public System.Collections.Generic.IReadOnlyCollection Attachments { get; } @@ -431,7 +418,6 @@ namespace Sentry public System.Collections.Generic.IReadOnlyDictionary Extra { get; } public System.Collections.Generic.IReadOnlyList Fingerprint { get; set; } public Sentry.SentryLevel? Level { get; set; } - public string? Platform { get; set; } public string? Release { get; set; } public Sentry.Request Request { get; set; } public Sentry.SdkVersion Sdk { get; } @@ -509,7 +495,7 @@ namespace Sentry public static System.Threading.Tasks.Task FlushAsync(this Sentry.ISentryClient client) { } } [System.Diagnostics.DebuggerDisplay("{GetType().Name,nq}: {EventId,nq}")] - public sealed class SentryEvent : Sentry.IEventLike, Sentry.IHasBreadcrumbs, Sentry.IHasExtra, Sentry.IHasTags, Sentry.IJsonSerializable + public sealed class SentryEvent : Sentry.IEventLike, Sentry.IHasExtra, Sentry.IHasTags, Sentry.IJsonSerializable { public SentryEvent() { } public SentryEvent(System.Exception? exception) { } @@ -809,7 +795,7 @@ namespace Sentry public System.Collections.Generic.IList FramesOmitted { get; } public string? Function { get; set; } public long? FunctionId { get; set; } - public long? ImageAddress { get; set; } + public long? ImageAddress { get; set; } public bool? InApp { get; set; } public long? InstructionAddress { get; set; } public int? LineNumber { get; set; } @@ -899,7 +885,7 @@ namespace Sentry public void WriteTo(System.Text.Json.Utf8JsonWriter writer, Sentry.Extensibility.IDiagnosticLogger? logger) { } public static Sentry.SessionUpdate FromJson(System.Text.Json.JsonElement json) { } } - public class Span : Sentry.IHasExtra, Sentry.IHasTags, Sentry.IJsonSerializable, Sentry.ISpanContext, Sentry.ISpanData, Sentry.Protocol.ITraceContext + public class Span : Sentry.IHasExtra, Sentry.IHasTags, Sentry.IJsonSerializable, Sentry.ISpanData, Sentry.Protocol.ITraceContext { public Span(Sentry.ISpan tracer) { } public Span(Sentry.SpanId? parentSpanId, string operation) { } @@ -908,6 +894,7 @@ namespace Sentry public System.Collections.Generic.IReadOnlyDictionary Extra { get; } public bool IsFinished { get; } public bool? IsSampled { get; } + public System.Collections.Generic.IReadOnlyDictionary Measurements { get; } public string Operation { get; set; } public Sentry.SpanId? ParentSpanId { get; } public Sentry.SpanId SpanId { get; } @@ -917,12 +904,13 @@ namespace Sentry public Sentry.SentryId TraceId { get; } public Sentry.SentryTraceHeader GetTraceHeader() { } public void SetExtra(string key, object? value) { } + public void SetMeasurement(string name, Sentry.Protocol.Measurement measurement) { } public void SetTag(string key, string value) { } public void UnsetTag(string key) { } public void WriteTo(System.Text.Json.Utf8JsonWriter writer, Sentry.Extensibility.IDiagnosticLogger? logger) { } public static Sentry.Span FromJson(System.Text.Json.JsonElement json) { } } - public class SpanContext : Sentry.ISpanContext, Sentry.Protocol.ITraceContext + public class SpanContext : Sentry.Protocol.ITraceContext { public SpanContext(Sentry.SpanId spanId, Sentry.SpanId? parentSpanId, Sentry.SentryId traceId, string operation, string? description, Sentry.SpanStatus? status, bool? isSampled) { } public string? Description { get; } @@ -934,6 +922,14 @@ namespace Sentry public Sentry.SpanStatus? Status { get; } public Sentry.SentryId TraceId { get; } } + public static class SpanDataExtensions + { + public static void SetMeasurement(this Sentry.ISpanData spanData, string name, double value, Sentry.MeasurementUnit unit = default) { } + public static void SetMeasurement(this Sentry.ISpanData spanData, string name, int value, Sentry.MeasurementUnit unit = default) { } + public static void SetMeasurement(this Sentry.ISpanData spanData, string name, long value, Sentry.MeasurementUnit unit = default) { } + [System.CLSCompliant(false)] + public static void SetMeasurement(this Sentry.ISpanData spanData, string name, ulong value, Sentry.MeasurementUnit unit = default) { } + } public static class SpanExtensions { public static Sentry.ITransaction GetTransaction(this Sentry.ISpan span) { } @@ -976,7 +972,7 @@ namespace Sentry OutOfRange = 15, DataLoss = 16, } - public class SpanTracer : Sentry.IHasExtra, Sentry.IHasTags, Sentry.ISpan, Sentry.ISpanContext, Sentry.ISpanData, Sentry.Protocol.ITraceContext + public class SpanTracer : Sentry.IHasExtra, Sentry.IHasTags, Sentry.ISpan, Sentry.ISpanData, Sentry.Protocol.ITraceContext { public SpanTracer(Sentry.IHub hub, Sentry.TransactionTracer transaction, Sentry.SpanId? parentSpanId, Sentry.SentryId traceId, string operation) { } public string? Description { get; set; } @@ -984,6 +980,7 @@ namespace Sentry public System.Collections.Generic.IReadOnlyDictionary Extra { get; } public bool IsFinished { get; } public bool? IsSampled { get; } + public System.Collections.Generic.IReadOnlyDictionary Measurements { get; } public string Operation { get; set; } public Sentry.SpanId? ParentSpanId { get; } public Sentry.SpanId SpanId { get; } @@ -997,6 +994,7 @@ namespace Sentry public void Finish(System.Exception exception, Sentry.SpanStatus status) { } public Sentry.SentryTraceHeader GetTraceHeader() { } public void SetExtra(string key, object? value) { } + public void SetMeasurement(string name, Sentry.Protocol.Measurement measurement) { } public void SetTag(string key, string value) { } public Sentry.ISpan StartChild(string operation) { } public void UnsetTag(string key) { } @@ -1033,7 +1031,7 @@ namespace Sentry public TracePropagationTarget(System.Text.RegularExpressions.Regex regex) { } public TracePropagationTarget(string substringOrRegexPattern, System.StringComparison comparison = 5) { } } - public class Transaction : Sentry.IEventLike, Sentry.IHasBreadcrumbs, Sentry.IHasExtra, Sentry.IHasTags, Sentry.IHasTransactionNameSource, Sentry.IJsonSerializable, Sentry.ISpanContext, Sentry.ISpanData, Sentry.ITransactionContext, Sentry.ITransactionData, Sentry.Protocol.ITraceContext + public class Transaction : Sentry.IEventLike, Sentry.IHasExtra, Sentry.IHasTags, Sentry.IJsonSerializable, Sentry.ISpanData, Sentry.ITransactionContext, Sentry.ITransactionData, Sentry.Protocol.ITraceContext { public Transaction(Sentry.ITransaction tracer) { } public Transaction(string name, string operation) { } @@ -1077,7 +1075,7 @@ namespace Sentry public void WriteTo(System.Text.Json.Utf8JsonWriter writer, Sentry.Extensibility.IDiagnosticLogger? logger) { } public static Sentry.Transaction FromJson(System.Text.Json.JsonElement json) { } } - public class TransactionContext : Sentry.SpanContext, Sentry.IHasTransactionNameSource, Sentry.ISpanContext, Sentry.ITransactionContext, Sentry.Protocol.ITraceContext + public class TransactionContext : Sentry.SpanContext, Sentry.ITransactionContext, Sentry.Protocol.ITraceContext { public TransactionContext(string name, string operation) { } public TransactionContext(string name, string operation, Sentry.SentryTraceHeader traceHeader) { } @@ -1106,11 +1104,9 @@ namespace Sentry public System.Collections.Generic.IReadOnlyDictionary CustomSamplingContext { get; } public Sentry.ITransactionContext TransactionContext { get; } } - public class TransactionTracer : Sentry.IEventLike, Sentry.IHasBreadcrumbs, Sentry.IHasExtra, Sentry.IHasTags, Sentry.IHasTransactionNameSource, Sentry.ISpan, Sentry.ISpanContext, Sentry.ISpanData, Sentry.ITransaction, Sentry.ITransactionContext, Sentry.ITransactionData, Sentry.Protocol.ITraceContext + public class TransactionTracer : Sentry.IEventLike, Sentry.IHasExtra, Sentry.IHasTags, Sentry.ISpan, Sentry.ISpanData, Sentry.ITransaction, Sentry.ITransactionContext, Sentry.ITransactionData, Sentry.Protocol.ITraceContext { public TransactionTracer(Sentry.IHub hub, Sentry.ITransactionContext context) { } - public TransactionTracer(Sentry.IHub hub, string name, string operation) { } - public TransactionTracer(Sentry.IHub hub, string name, string operation, Sentry.TransactionNameSource nameSource) { } public System.Collections.Generic.IReadOnlyCollection Breadcrumbs { get; } public Sentry.Contexts Contexts { get; set; } public string? Description { get; set; } diff --git a/test/Sentry.Tests/ApiApprovalTests.verify.cs b/test/Sentry.Tests/ApiApprovalTests.verify.cs index 4f8479b716..952e4e6edd 100644 --- a/test/Sentry.Tests/ApiApprovalTests.verify.cs +++ b/test/Sentry.Tests/ApiApprovalTests.verify.cs @@ -3,15 +3,9 @@ namespace Sentry.Tests; [UsesVerify] public class ApiApprovalTests { - [SkippableFact()] + [Fact] public Task Run() { - // Skip this test in the feat/v4.0.0 branch - var assembly = AppDomain.CurrentDomain.GetAssemblies(). - SingleOrDefault(assembly => assembly.GetName().Name == "Sentry"); - var version = assembly.GetVersion(); - Skip.If(version.StartsWith("3")); - return typeof(SentrySdk).Assembly.CheckApproval(); } }