26 writes to Current
Microsoft.AspNetCore.Components (3)
ComponentsActivitySource.cs (3)
39Activity.Current = null; // do not inherit the parent activity 76Activity.Current = null; // do not inherit the parent activity 136Activity.Current = activityHandle.Previous;
Microsoft.AspNetCore.Components.Server (2)
Circuits\CircuitActivitySource.cs (2)
30Activity.Current = null; // do not inherit the parent activity 79Activity.Current = activityHandle.Previous;
Microsoft.AspNetCore.SignalR.Core (4)
Internal\DefaultHubDispatcher.cs (4)
402Activity.Current = null; 430Activity.Current = previousActivity; 522Activity.Current = null; 594Activity.Current = previousActivity;
Microsoft.Extensions.AI (8)
ChatCompletion\FunctionInvokingChatClient.cs (6)
469Activity.Current = activity; // workaround for https://github.com/dotnet/runtime/issues/47802 486Activity.Current = activity; // workaround for https://github.com/dotnet/runtime/issues/47802 575Activity.Current = activity; // workaround for https://github.com/dotnet/runtime/issues/47802 612Activity.Current = activity; // workaround for https://github.com/dotnet/runtime/issues/47802 638Activity.Current = activity; // workaround for https://github.com/dotnet/runtime/issues/47802 672Activity.Current = activity; // workaround for https://github.com/dotnet/runtime/issues/47802
ChatCompletion\OpenTelemetryChatClient.cs (1)
265Activity.Current = activity; // workaround for https://github.com/dotnet/runtime/issues/47802
SpeechToText\OpenTelemetrySpeechToTextClient.cs (1)
187Activity.Current = activity; // workaround for https://github.com/dotnet/runtime/issues/47802
Stress.ApiService (6)
Program.cs (6)
91Activity.Current = null; 95Activity.Current = activity; 132Activity.Current = null; 146Activity.Current = current; 354Activity.Current = null; 361Activity.Current = current;
System.Net.Http (1)
System\Net\Http\SocketsHttpHandler\ConnectionPool\ConnectionSetupDistributedTracing.cs (1)
22Activity.Current = null;
System.Net.NameResolution (1)
System\Net\Dns.cs (1)
928Activity.Current = activityToRestore;
System.Net.Sockets (1)
System\Net\Sockets\SocketsTelemetry.cs (1)
101Activity.Current = activityToReset;
53 references to Current
aspire (1)
Telemetry\AspireCliTelemetry.cs (1)
146var activity = FindReportedActivity(Activity.Current);
Aspire.Dashboard (1)
Components\Pages\Error.razor.cs (1)
24RequestId = Activity.Current?.Id ?? HttpContext?.TraceIdentifier;
Aspire.StackExchange.Redis (1)
src\Vendoring\OpenTelemetry.Instrumentation.StackExchangeRedis\StackExchangeRedisConnectionInstrumentation.cs (1)
77var parent = Activity.Current;
dotnet (2)
CommandFactory\CommandResolution\ActivityContextFactory.cs (1)
17var currentActivity = Activity.Current;
Telemetry\TelemetryClient.cs (1)
224Activity.Current?.AddEvent(@event);
Microsoft.AspNetCore.Components (3)
ComponentsActivitySource.cs (3)
37var httpActivity = Activity.Current; 74var previousActivity = Activity.Current; 134if (Activity.Current == null && activityHandle.Previous != null && !activityHandle.Previous.IsStopped)
Microsoft.AspNetCore.Components.Server (2)
Circuits\CircuitActivitySource.cs (2)
28var signalRActivity = Activity.Current; 77if (Activity.Current == null && activityHandle.Previous != null && !activityHandle.Previous.IsStopped)
Microsoft.AspNetCore.Http.Extensions (1)
DefaultProblemDetailsWriter.cs (1)
58var traceId = Activity.Current?.Id ?? httpContext.TraceIdentifier;
Microsoft.AspNetCore.Mvc.Core (1)
Infrastructure\DefaultProblemDetailsFactory.cs (1)
105var traceId = Activity.Current?.Id ?? httpContext?.TraceIdentifier;
Microsoft.AspNetCore.SignalR.Core (5)
HubConnectionHandler.cs (1)
136OriginalActivity = Activity.Current,
Internal\DefaultHubDispatcher.cs (4)
399var previousActivity = Activity.Current; 428if (Activity.Current != previousActivity) 519var previousActivity = Activity.Current; 592if (Activity.Current != previousActivity)
Microsoft.Build.Framework (2)
Telemetry\MSBuildActivitySource.cs (2)
47Activity? activity = Activity.Current?.HasRemoteParent == true 48? _source.StartActivity(eventName, ActivityKind.Internal, parentId: Activity.Current.ParentId)
Microsoft.Extensions.AI (3)
ChatCompletion\FunctionInvokingChatClient.cs (3)
1370/// <summary>Gets a value indicating whether <see cref="Activity.Current"/> represents an "invoke_agent" span.</summary> 1375string? name = Activity.Current?.DisplayName; 1395Activity? invokeAgentActivity = CurrentActivityIsInvokeAgent ? Activity.Current : null;
Microsoft.Extensions.AI.OpenAI (1)
OpenAIClientExtensions.cs (1)
302Activity? activity = Activity.Current;
Microsoft.Extensions.Logging (1)
LoggerFactoryScopeProvider.cs (1)
37Activity? activity = Activity.Current;
Microsoft.Extensions.Logging.EventSource (1)
EventSourceLogger.cs (1)
83Activity? activity = Activity.Current;
Microsoft.Extensions.Telemetry (2)
Logging\Import\LoggerFactoryScopeProvider.cs (1)
52Activity? activity = Activity.Current;
Sampling\TraceBasedSampler.cs (1)
13Activity.Current?.Recorded ?? true;
Microsoft.Extensions.Telemetry.Tests (1)
Logging\ExtendedLoggerFactoryTests.cs (1)
129Activity activity = Activity.Current!;
OrderProcessor (2)
OrderProcessingWorker.cs (2)
68Activity.Current?.AddTag("order-id", order.Id); 69Activity.Current?.AddTag("product-count", order.Items.Count);
Stress.ApiService (3)
Program.cs (3)
90var activity = Activity.Current; 131var current = Activity.Current; 353var current = Activity.Current;
System.Diagnostics.DiagnosticSource (14)
System\Diagnostics\Activity.cs (6)
19/// Carries the <see cref="Activity.Current"/> changed event data. 82/// Event occur when the <see cref="Activity.Current"/> value changes. 783/// <item>Sets <see cref="Parent"/> to hold <see cref="Current"/>.</item> 784/// <item>Sets <see cref="Current"/> to this activity.</item> 801_previousActiveActivity = Current; 842/// Stops activity: sets <see cref="Current"/> to <see cref="Parent"/>.
System\Diagnostics\ActivityCreationOptions.cs (2)
80IdFormat = Activity.Current != null ? Activity.Current.IdFormat : Activity.DefaultIdFormat;
System\Diagnostics\ActivitySource.cs (2)
300bool useCurrentActivityContext = context == default && Activity.Current != null; 301var aco = new ActivityCreationOptions<ActivityContext>(this, name, useCurrentActivityContext ? Activity.Current!.Context : context, kind, tags, links, idFormat);
System\Diagnostics\DiagnosticSourceActivity.cs (2)
19/// was started. Consumers could access <see cref="Activity.Current"/> 44/// that Activity was stopped. Consumers could access <see cref="Activity.Current"/>
System\Diagnostics\DsesFilterAndTransform.cs (1)
953return Activity.Current;
System\Diagnostics\PassThroughPropagator.cs (1)
46Activity? activity = Activity.Current;
System.Net.Http (4)
System\Net\Http\DiagnosticsHandler.cs (2)
53return Activity.Current != null || 67(Activity.Current is not null ||
System\Net\Http\SocketsHttpHandler\ConnectionPool\ConnectionSetupDistributedTracing.cs (1)
88Activity? requestActivity = Activity.Current;
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionWaiter.cs (1)
24|| (GlobalHttpSettings.DiagnosticsHandler.EnableActivityPropagation && Activity.Current?.Source == DiagnosticsHandler.s_activitySource);
System.Net.NameResolution (1)
System\Net\Dns.cs (1)
923Activity? activityToRestore = tracingEnabled ? Activity.Current : null;
System.Net.Sockets (1)
System\Net\Sockets\SocketsTelemetry.cs (1)
96Activity? activityToReset = keepActivityCurrent ? Activity.Current : null;