diff --git a/CHANGELOG.md b/CHANGELOG.md
index fd42ecb4ee..4cdcdbe99b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -32,6 +32,7 @@ API Changes:
- Reordered parameters for ther TransactionContext and SpanContext constructors. If you're constructing instances of these classes, you will need to adjust the order in which you pass parameters to these. ([#2696](https://github.com/getsentry/sentry-dotnet/pull/2696))
- The `DiagnosticLogger` signature for `LogError` and `LogFatal` changed to take the `exception` as the first parameter. That way it does no longer get mixed up with the TArgs. The `DiagnosticLogger` now also received an overload for `LogError` and `LogFatal` that accepts a message only. ([#2715](https://github.com/getsentry/sentry-dotnet/pull/2715))
- Integrate `sentry-native` as a static library in Native AOT builds to enable symbolication. ([2704](https://github.com/getsentry/sentry-dotnet/pull/2704))
+- `ISpan` and `ITransaction` have been renamed to `ISpanTracer` and `ITransactionTracer`. You will need to update any references to these interfaces in your code to use the new interface names ([#2731](https://github.com/getsentry/sentry-dotnet/pull/2731))
## Unreleased
diff --git a/benchmarks/Sentry.Benchmarks/StackFrameBenchmarks.cs b/benchmarks/Sentry.Benchmarks/StackFrameBenchmarks.cs
index 840ac42b99..6797013c45 100644
--- a/benchmarks/Sentry.Benchmarks/StackFrameBenchmarks.cs
+++ b/benchmarks/Sentry.Benchmarks/StackFrameBenchmarks.cs
@@ -145,7 +145,7 @@ public void ConfigureAppFrame()
Module ="Sentry.Extensions.Profiling"
},
new SentryStackFrame() {
- Function ="SamplingTransactionProfiler.Start(class Sentry.ITransaction) {QuickJitted}",
+ Function ="SamplingTransactionProfiler.Start(class Sentry.ITransactionTracer) {QuickJitted}",
Module ="Sentry.Extensions.Profiling"
},
new SentryStackFrame() {
diff --git a/src/Sentry.AspNet/HttpContextExtensions.cs b/src/Sentry.AspNet/HttpContextExtensions.cs
index c3e642cffd..aa266ba2b5 100644
--- a/src/Sentry.AspNet/HttpContextExtensions.cs
+++ b/src/Sentry.AspNet/HttpContextExtensions.cs
@@ -77,7 +77,7 @@ public static void StartOrContinueTrace(this HttpContext httpContext)
///
/// Starts a new Sentry transaction that encompasses the currently executing HTTP request.
///
- public static ITransaction StartSentryTransaction(this HttpContext httpContext)
+ public static ITransactionTracer StartSentryTransaction(this HttpContext httpContext)
{
var method = httpContext.Request.HttpMethod;
var path = httpContext.Request.Path;
@@ -136,7 +136,7 @@ public static void FinishSentryTransaction(this HttpContext httpContext)
return;
}
- if (httpContext.Items[HttpContextTransactionItemName] is not ISpan transaction)
+ if (httpContext.Items[HttpContextTransactionItemName] is not ISpanTracer transaction)
{
return;
}
diff --git a/src/Sentry.AspNetCore/SentryTracingMiddleware.cs b/src/Sentry.AspNetCore/SentryTracingMiddleware.cs
index be5a15bdcc..7cefd8af55 100644
--- a/src/Sentry.AspNetCore/SentryTracingMiddleware.cs
+++ b/src/Sentry.AspNetCore/SentryTracingMiddleware.cs
@@ -27,7 +27,7 @@ public SentryTracingMiddleware(
_options = options.Value;
}
- private ITransaction? TryStartTransaction(HttpContext context)
+ private ITransactionTracer? TryStartTransaction(HttpContext context)
{
if (context.Request.Method == HttpMethod.Options.Method)
{
diff --git a/src/Sentry.DiagnosticSource/Internal/DiagnosticSource/EFCommandDiagnosticSourceHelper.cs b/src/Sentry.DiagnosticSource/Internal/DiagnosticSource/EFCommandDiagnosticSourceHelper.cs
index 1d600b7365..e807cfda7a 100644
--- a/src/Sentry.DiagnosticSource/Internal/DiagnosticSource/EFCommandDiagnosticSourceHelper.cs
+++ b/src/Sentry.DiagnosticSource/Internal/DiagnosticSource/EFCommandDiagnosticSourceHelper.cs
@@ -15,16 +15,16 @@ internal EFCommandDiagnosticSourceHelper(IHub hub, SentryOptions options) : base
private static Guid? GetCommandId(object? diagnosticSourceValue) => diagnosticSourceValue?.GetGuidProperty("CommandId");
- private static void SetCommandId(ISpan span, Guid? commandId)
+ private static void SetCommandId(ISpanTracer span, Guid? commandId)
{
Debug.Assert(commandId != Guid.Empty);
span.SetExtra(EFKeys.DbCommandId, commandId);
}
- private static Guid? TryGetCommandId(ISpan span) => span.Extra.TryGetValue(EFKeys.DbCommandId);
+ private static Guid? TryGetCommandId(ISpanTracer span) => span.Extra.TryGetValue(EFKeys.DbCommandId);
- protected override ISpan? GetSpanReference(ITransaction transaction, object? diagnosticSourceValue)
+ protected override ISpanTracer? GetSpanReference(ITransactionTracer transaction, object? diagnosticSourceValue)
{
if (GetCommandId(diagnosticSourceValue) is { } commandId)
{
@@ -38,7 +38,7 @@ private static void SetCommandId(ISpan span, Guid? commandId)
return null;
}
- protected override void SetSpanReference(ISpan span, object? diagnosticSourceValue)
+ protected override void SetSpanReference(ISpanTracer span, object? diagnosticSourceValue)
{
if (GetCommandId(diagnosticSourceValue) is { } commandId)
{
diff --git a/src/Sentry.DiagnosticSource/Internal/DiagnosticSource/EFConnectionDiagnosticSourceHelper.cs b/src/Sentry.DiagnosticSource/Internal/DiagnosticSource/EFConnectionDiagnosticSourceHelper.cs
index 61bff526d9..822f94c066 100644
--- a/src/Sentry.DiagnosticSource/Internal/DiagnosticSource/EFConnectionDiagnosticSourceHelper.cs
+++ b/src/Sentry.DiagnosticSource/Internal/DiagnosticSource/EFConnectionDiagnosticSourceHelper.cs
@@ -13,7 +13,7 @@ internal EFConnectionDiagnosticSourceHelper(IHub hub, SentryOptions options) : b
protected override string? GetDescription(object? diagnosticSourceValue) => GetDatabaseName(diagnosticSourceValue);
- protected override ISpan? GetSpanReference(ITransaction transaction, object? diagnosticSourceValue)
+ protected override ISpanTracer? GetSpanReference(ITransactionTracer transaction, object? diagnosticSourceValue)
{
if (GetConnectionId(diagnosticSourceValue) is { } connectionId)
{
@@ -27,7 +27,7 @@ internal EFConnectionDiagnosticSourceHelper(IHub hub, SentryOptions options) : b
return null;
}
- protected override void SetSpanReference(ISpan span, object? diagnosticSourceValue)
+ protected override void SetSpanReference(ISpanTracer span, object? diagnosticSourceValue)
{
if (GetConnectionId(diagnosticSourceValue) is { } connectionId)
{
diff --git a/src/Sentry.DiagnosticSource/Internal/DiagnosticSource/EFDiagnosticSourceHelper.cs b/src/Sentry.DiagnosticSource/Internal/DiagnosticSource/EFDiagnosticSourceHelper.cs
index 48dcfc2eef..e283ae1c35 100644
--- a/src/Sentry.DiagnosticSource/Internal/DiagnosticSource/EFDiagnosticSourceHelper.cs
+++ b/src/Sentry.DiagnosticSource/Internal/DiagnosticSource/EFDiagnosticSourceHelper.cs
@@ -6,7 +6,7 @@ namespace Sentry.Internal.DiagnosticSource;
internal abstract class EFDiagnosticSourceHelper
{
protected SentryOptions Options { get; }
- protected ITransaction? Transaction { get; }
+ protected ITransactionTracer? Transaction { get; }
protected abstract string Operation { get; }
protected abstract string? GetDescription(object? diagnosticSourceValue);
@@ -39,11 +39,11 @@ internal EFDiagnosticSourceHelper(IHub hub, SentryOptions options)
Transaction = hub.GetTransactionIfSampled();
}
- protected static Guid? TryGetConnectionId(ISpan span) => span.Extra.TryGetValue(EFKeys.DbConnectionId);
+ protected static Guid? TryGetConnectionId(ISpanTracer span) => span.Extra.TryGetValue(EFKeys.DbConnectionId);
protected static Guid? GetConnectionId(object? diagnosticSourceValue) => diagnosticSourceValue?.GetGuidProperty("ConnectionId");
- protected static void SetConnectionId(ISpan span, Guid? connectionId)
+ protected static void SetConnectionId(ISpanTracer span, Guid? connectionId)
{
Debug.Assert(connectionId != Guid.Empty);
@@ -89,7 +89,7 @@ internal void FinishSpan(object? diagnosticSourceValue, SpanStatus status)
sourceSpan.Finish(status);
}
- protected void SetDbData(ISpan span, object? diagnosticSourceValue)
+ protected void SetDbData(ISpanTracer span, object? diagnosticSourceValue)
{
if (GetDatabaseName(diagnosticSourceValue) is { } dataBaseName)
{
@@ -140,7 +140,7 @@ protected void LogTransactionSpans()
return str?[(str.IndexOf('\n') + 1)..];
}
- protected abstract ISpan? GetSpanReference(ITransaction transaction, object? diagnosticSourceValue);
+ protected abstract ISpanTracer? GetSpanReference(ITransactionTracer transaction, object? diagnosticSourceValue);
- protected abstract void SetSpanReference(ISpan span, object? diagnosticSourceValue);
+ protected abstract void SetSpanReference(ISpanTracer span, object? diagnosticSourceValue);
}
diff --git a/src/Sentry.DiagnosticSource/Internal/DiagnosticSource/EFQueryCompilerDiagnosticSourceHelper.cs b/src/Sentry.DiagnosticSource/Internal/DiagnosticSource/EFQueryCompilerDiagnosticSourceHelper.cs
index c056ab0da0..78f71bcbf1 100644
--- a/src/Sentry.DiagnosticSource/Internal/DiagnosticSource/EFQueryCompilerDiagnosticSourceHelper.cs
+++ b/src/Sentry.DiagnosticSource/Internal/DiagnosticSource/EFQueryCompilerDiagnosticSourceHelper.cs
@@ -13,10 +13,10 @@ internal EFQueryCompilerDiagnosticSourceHelper(IHub hub, SentryOptions options)
///
/// We don't have a correlation id for compiled query events. We just return the first unfinished query compile span.
///
- protected override ISpan? GetSpanReference(ITransaction transaction, object? diagnosticSourceValue) =>
+ protected override ISpanTracer? GetSpanReference(ITransactionTracer transaction, object? diagnosticSourceValue) =>
transaction.Spans .FirstOrDefault(span => !span.IsFinished && span.Operation == Operation);
- protected override void SetSpanReference(ISpan span, object? diagnosticSourceValue)
+ protected override void SetSpanReference(ISpanTracer span, object? diagnosticSourceValue)
{
// We don't have a correlation id for compiled query events.
}
diff --git a/src/Sentry.DiagnosticSource/Internal/DiagnosticSource/SentrySqlListener.cs b/src/Sentry.DiagnosticSource/Internal/DiagnosticSource/SentrySqlListener.cs
index d2e0acf5fe..76d381deae 100644
--- a/src/Sentry.DiagnosticSource/Internal/DiagnosticSource/SentrySqlListener.cs
+++ b/src/Sentry.DiagnosticSource/Internal/DiagnosticSource/SentrySqlListener.cs
@@ -38,37 +38,37 @@ public SentrySqlListener(IHub hub, SentryOptions options)
_options = options;
}
- private static void SetDatabaseName(ISpan span, string databaseName)
+ private static void SetDatabaseName(ISpanTracer span, string databaseName)
{
Debug.Assert(databaseName != string.Empty);
span.SetExtra(OTelKeys.DbName, databaseName);
}
- private static void SetDatabaseAddress(ISpan span, string databaseAddress)
+ private static void SetDatabaseAddress(ISpanTracer span, string databaseAddress)
{
Debug.Assert(databaseAddress != string.Empty);
span.SetExtra(OTelKeys.DbServer, databaseAddress);
}
- private static void SetConnectionId(ISpan span, Guid? connectionId)
+ private static void SetConnectionId(ISpanTracer span, Guid? connectionId)
{
Debug.Assert(connectionId != Guid.Empty);
span.SetExtra(SqlKeys.DbConnectionId, connectionId);
}
- private static void SetOperationId(ISpan span, Guid? operationId)
+ private static void SetOperationId(ISpanTracer span, Guid? operationId)
{
Debug.Assert(operationId != Guid.Empty);
span.SetExtra(SqlKeys.DbOperationId, operationId);
}
- private static Guid? TryGetOperationId(ISpan span) => span.Extra.TryGetValue(SqlKeys.DbOperationId);
+ private static Guid? TryGetOperationId(ISpanTracer span) => span.Extra.TryGetValue(SqlKeys.DbOperationId);
- private static Guid? TryGetConnectionId(ISpan span) => span.Extra.TryGetValue(SqlKeys.DbConnectionId);
+ private static Guid? TryGetConnectionId(ISpanTracer span) => span.Extra.TryGetValue(SqlKeys.DbConnectionId);
private void AddSpan(string operation, object? value)
{
@@ -85,7 +85,7 @@ private void AddSpan(string operation, object? value)
SetConnectionId(span, value?.GetGuidProperty("ConnectionId"));
}
- private ISpan? GetSpan(SentrySqlSpanType type, object? value)
+ private ISpanTracer? GetSpan(SentrySqlSpanType type, object? value)
{
var transaction = _hub.GetTransactionIfSampled();
if (transaction == null)
@@ -124,7 +124,7 @@ private void AddSpan(string operation, object? value)
}
}
- private static ISpan? TryGetConnectionSpan(ITransaction transaction, Guid? connectionId) =>
+ private static ISpanTracer? TryGetConnectionSpan(ITransactionTracer transaction, Guid? connectionId) =>
connectionId == null
? null
: transaction.Spans
@@ -132,7 +132,7 @@ private void AddSpan(string operation, object? value)
span is {IsFinished: false, Operation: "db.connection"} &&
TryGetConnectionId(span) == connectionId);
- private static ISpan? TryGetQuerySpan(ITransaction transaction, Guid? operationId) =>
+ private static ISpanTracer? TryGetQuerySpan(ITransactionTracer transaction, Guid? operationId) =>
operationId == null
? null
: transaction.Spans.FirstOrDefault(span => TryGetOperationId(span) == operationId);
@@ -248,7 +248,7 @@ when GetSpan(SentrySqlSpanType.Connection, kvp.Value) is { } closeSpan:
}
}
- private static void TrySetConnectionStatistics(ISpan span, object? value)
+ private static void TrySetConnectionStatistics(ISpanTracer span, object? value)
{
if (value?.GetProperty("Statistics") is not Dictionary