11 instantiations of Activity
Microsoft.AspNetCore.Hosting (1)
Internal\HostingApplicationDiagnostics.cs (1)
421activity = new Activity(ActivityName);
Microsoft.AspNetCore.Http.Connections.Tests (1)
HttpConnectionDispatcherTests.cs (1)
3123var activityFeature = new TestActivityFeature(new Activity("name"));
Microsoft.AspNetCore.Mvc.Core.TestCommon (1)
ActivityReplacer.cs (1)
14_activity = new Activity("Test");
Microsoft.AspNetCore.SignalR.Tests (6)
HubConnectionHandlerTests.Activity.cs (6)
43var mockHttpRequestActivity = new Activity("HttpRequest"); 114var mockHttpRequestActivity = new Activity("HttpRequest"); 179var mockHttpRequestActivity = new Activity("HttpRequest"); 226var mockHttpRequestActivity = new Activity("HttpRequest"); 277var mockHttpRequestActivity = new Activity("HttpRequest"); 327var mockHttpRequestActivity = new Activity("HttpRequest");
System.Diagnostics.DiagnosticSource (1)
System\Diagnostics\Activity.cs (1)
1165Activity activity = new Activity(name);
System.Net.Http (1)
System\Net\Http\DiagnosticsHandler.cs (1)
68activity = new Activity(DiagnosticsHandlerLoggingStrings.ActivityName);
289 references to Activity
ClaimsTransformation (1)
Controllers\HomeController.cs (1)
26return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
Cookies (1)
Controllers\HomeController.cs (1)
26return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
DynamicSchemes (1)
Pages\Error.cshtml.cs (1)
21RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier;
HostedBlazorWebassemblyApp.Server (1)
Pages\Error.cshtml.cs (1)
32RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier;
Identity.DefaultUI.WebSite (1)
Pages\Error.cshtml.cs (1)
19RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier;
Identity.ExternalClaims (1)
Pages\Error.cshtml.cs (1)
21RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier;
Microsoft.AspNetCore.Hosting (10)
Internal\HostingApplication.cs (1)
125public Activity? Activity
Internal\HostingApplicationDiagnostics.cs (7)
210var activity = context.Activity; 382private Activity? StartActivity(HttpContext httpContext, bool loggingEnabled, bool diagnosticListenerActivityCreationEnabled, out bool hasDiagnosticListener) 397Activity? activity = null; 474private void StopActivity(HttpContext httpContext, Activity activity, bool hasDiagnosticListener) 502private Activity StartActivity(Activity activity, HttpContext httpContext) 516private void StopActivity(Activity activity, HttpContext httpContext)
Internal\HttpActivityFeature.cs (2)
14internal HttpActivityFeature(Activity activity) 20public Activity Activity { get; set; }
Microsoft.AspNetCore.Hosting.Tests (49)
HostingApplicationDiagnosticsTests.cs (42)
256Assert.Null(Activity.Current); 296Assert.Null(Activity.Current); 327Assert.Null(Activity.Current); 364Assert.NotNull(Activity.Current); 384Assert.NotNull(Activity.Current); 385Assert.Equal("Microsoft.AspNetCore.Hosting.HttpRequestIn", Activity.Current.OperationName); 391Assert.NotNull(Activity.Current); 408Assert.NotNull(Activity.Current); 409Assert.True(Activity.Current.Duration > TimeSpan.Zero); 410Assert.Equal("Microsoft.AspNetCore.Hosting.HttpRequestIn", Activity.Current.OperationName); 432Assert.NotNull(Activity.Current); 433Assert.True(Activity.Current.Duration > TimeSpan.Zero); 434Assert.Equal("Microsoft.AspNetCore.Hosting.HttpRequestIn", Activity.Current.OperationName); 456Assert.NotNull(Activity.Current); 457Assert.Equal("Microsoft.AspNetCore.Hosting.HttpRequestIn", Activity.Current.OperationName); 484Assert.NotNull(Activity.Current); 485Assert.Equal("Microsoft.AspNetCore.Hosting.HttpRequestIn", Activity.Current.OperationName); 513Assert.Equal("Microsoft.AspNetCore.Hosting.HttpRequestIn", Activity.Current.OperationName); 514Assert.Equal("ParentId1", Activity.Current.ParentId); 515Assert.Contains(Activity.Current.Baggage, pair => pair.Key == "Key1" && pair.Value == "value1"); 516Assert.Contains(Activity.Current.Baggage, pair => pair.Key == "Key2" && pair.Value == "value2"); 544Assert.Equal("Microsoft.AspNetCore.Hosting.HttpRequestIn", Activity.Current.OperationName); 545Assert.Contains(Activity.Current.Baggage, pair => pair.Key == "Key1" && pair.Value == "value1"); 546Assert.Contains(Activity.Current.Baggage, pair => pair.Key == "Key2" && pair.Value == "value2"); 575Assert.Equal("Microsoft.AspNetCore.Hosting.HttpRequestIn", Activity.Current.OperationName); 576Assert.Contains(Activity.Current.Baggage, pair => pair.Key == "Key1" && pair.Value == "value3"); 577Assert.Contains(Activity.Current.Baggage, pair => pair.Key == "Key2" && pair.Value == "value4"); 605Assert.Equal("Microsoft.AspNetCore.Hosting.HttpRequestIn", Activity.Current.OperationName); 614Assert.Equal(expectedBaggage, Activity.Current.Baggage.ToArray()); 642Assert.Equal("Microsoft.AspNetCore.Hosting.HttpRequestIn", Activity.Current.OperationName); 643Assert.Contains(Activity.Current.Baggage, pair => pair.Key == "Key1" && pair.Value == "value1/1"); 672Assert.Equal("Microsoft.AspNetCore.Hosting.HttpRequestIn", Activity.Current.OperationName); 673Assert.Equal(ActivityIdFormat.W3C, Activity.Current.IdFormat); 674Assert.Equal("0123456789abcdef0123456789abcdef", Activity.Current.TraceId.ToHexString()); 675Assert.Equal("0123456789abcdef", Activity.Current.ParentSpanId.ToHexString()); 676Assert.Equal("TraceState1", Activity.Current.TraceStateString); 678Assert.Contains(Activity.Current.Baggage, pair => pair.Key == "Key1" && pair.Value == "value1"); 679Assert.Contains(Activity.Current.Baggage, pair => pair.Key == "Key2" && pair.Value == "value2"); 739Assert.Null(Activity.Current); 750Assert.NotNull(Activity.Current); 751Assert.True(Activity.Current.Recorded); 766parentSpanId = Activity.Current.ParentSpanId.ToHexString();
HostingApplicationTests.cs (7)
113var initialActivity = Activity.Current; 116using var dummyActivity = dummySource.StartActivity("DummyActivity"); 118Assert.Equal(Activity.Current, dummyActivity); 122Assert.Equal(activityFeature.Activity.Id, Activity.Current.ParentId); 123Assert.NotEqual(Activity.Current, activityFeature.Activity); 131public Activity Activity { get; set; }
Microsoft.AspNetCore.Http (1)
Features\IHttpActivityFeature.cs (1)
16Activity Activity { get; set; }
Microsoft.AspNetCore.Http.Connections.Tests (3)
HttpConnectionDispatcherTests.cs (3)
3095public TestActivityFeature(Activity activity) 3100public Activity Activity { get; set; } 3129Assert.Equal("true", Activity.Current.GetTagItem("http.long_running"));
Microsoft.AspNetCore.Http.Extensions (1)
DefaultProblemDetailsWriter.cs (1)
58var traceId = Activity.Current?.Id ?? httpContext.TraceIdentifier;
Microsoft.AspNetCore.Http.Extensions.Tests (14)
ProblemDetailsDefaultWriterTest.cs (14)
29var expectedTraceId = Activity.Current?.Id ?? context.TraceIdentifier; 66var expectedTraceId = Activity.Current?.Id ?? context.TraceIdentifier; 98var expectedTraceId = Activity.Current?.Id ?? context.TraceIdentifier; 132var expectedTraceId = Activity.Current?.Id ?? context.TraceIdentifier; 174var expectedTraceId = Activity.Current?.Id ?? context.TraceIdentifier; 214var expectedTraceId = Activity.Current?.Id ?? context.TraceIdentifier; 251var expectedTraceId = Activity.Current?.Id ?? context.TraceIdentifier; 294var expectedTraceId = Activity.Current?.Id ?? context.TraceIdentifier; 337var expectedTraceId = Activity.Current?.Id ?? context.TraceIdentifier; 380var expectedTraceId = Activity.Current?.Id ?? context.TraceIdentifier; 423var expectedTraceId = Activity.Current?.Id ?? context.TraceIdentifier; 464var expectedTraceId = Activity.Current?.Id ?? context.TraceIdentifier; 511var expectedTraceId = Activity.Current?.Id ?? context.TraceIdentifier; 552var expectedTraceId = Activity.Current?.Id ?? context.TraceIdentifier;
Microsoft.AspNetCore.Identity.UI (2)
Areas\Identity\Pages\V4\Error.cshtml.cs (1)
37RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier;
Areas\Identity\Pages\V5\Error.cshtml.cs (1)
37RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier;
Microsoft.AspNetCore.Mvc.Core (1)
Infrastructure\DefaultProblemDetailsFactory.cs (1)
105var traceId = Activity.Current?.Id ?? httpContext?.TraceIdentifier;
Microsoft.AspNetCore.Mvc.Core.Test (2)
DependencyInjection\ApiBehaviorOptionsSetupTest.cs (1)
110Assert.Equal(Activity.Current.Id, problemDetails.Extensions["traceId"]);
Infrastructure\ProblemDetalsClientErrorFactoryTest.cs (1)
91Assert.Equal(Activity.Current.Id, problemDetails.Extensions["traceId"]);
Microsoft.AspNetCore.Mvc.Core.TestCommon (2)
ActivityReplacer.cs (2)
10private readonly Activity _activity; 20Debug.Assert(Activity.Current == _activity);
Microsoft.AspNetCore.Mvc.FunctionalTests (1)
XmlSerializerFormattersWrappingTest.cs (1)
201$"<traceId>{Activity.Current.Id}</traceId>" +
Microsoft.AspNetCore.SignalR.Core (9)
HubConnectionContext.cs (1)
62internal Activity? OriginalActivity { get; set; }
HubConnectionHandler.cs (2)
135OriginalActivity = Activity.Current, 140Activity.Current = null;
Internal\DefaultHubDispatcher.cs (6)
81Activity? activity = null; 117Activity? activity = null; 392var activity = StartActivity(connection, scope.ServiceProvider, hubMethodInvocationMessage.Target); 498var activity = StartActivity(connection, scope.ServiceProvider, hubMethodInvocationMessage.Target); 794private static Activity? StartActivity(HubConnectionContext connectionContext, IServiceProvider serviceProvider, string methodName) 817private static void SetActivityError(Activity? activity, Exception ex)
Microsoft.AspNetCore.SignalR.Tests (27)
HubConnectionHandlerTests.Activity.cs (26)
21var activities = new List<Activity>(); 43var mockHttpRequestActivity = new Activity("HttpRequest"); 45Activity.Current = mockHttpRequestActivity; 53var activity = Assert.Single(activities); 95var activities = new List<Activity>(); 114var mockHttpRequestActivity = new Activity("HttpRequest"); 116Activity.Current = mockHttpRequestActivity; 126var activity = Assert.Single(activities); 160var activities = new List<Activity>(); 179var mockHttpRequestActivity = new Activity("HttpRequest"); 181Activity.Current = mockHttpRequestActivity; 189var activity = Assert.Single(activities); 207var activities = new List<Activity>(); 226var mockHttpRequestActivity = new Activity("HttpRequest"); 228Activity.Current = mockHttpRequestActivity; 241var activity = activities[1]; 258var activities = new List<Activity>(); 277var mockHttpRequestActivity = new Activity("HttpRequest"); 279Activity.Current = mockHttpRequestActivity; 290var activity = activities[1]; 308var activities = new List<Activity>(); 327var mockHttpRequestActivity = new Activity("HttpRequest"); 329Activity.Current = mockHttpRequestActivity; 340var activity = activities[1]; 347private static void AssertHubMethodActivity<THub>(Activity activity, string methodName, Activity httpActivity, Type exceptionType = null)
HubConnectionHandlerTestUtils\Hubs.cs (1)
376var activity = testActivitySource.ActivitySource.StartActivity("inner", ActivityKind.Server);
Microsoft.Extensions.Logging (7)
LoggerFactoryScopeProvider.cs (7)
37Activity? activity = Activity.Current; 78private static ActivityBaggageLogScopeWrapper GetOrCreateActivityBaggageLogScopeWrapper(Activity activity, IEnumerable<KeyValuePair<string, string?>> items) 137public ActivityLogScope(Activity activity, ActivityTrackingOptions activityTrackingOption) 291public static string GetSpanId(this Activity activity) 301public static string GetTraceId(this Activity activity) 311public static string GetParentId(this Activity activity)
MvcFormSample (1)
Controllers\HomeController.cs (1)
48return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
PathSchemeSelection (1)
Controllers\HomeController.cs (1)
26return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
StaticFilesAuth (1)
Controllers\HomeController.cs (1)
24return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
System.Diagnostics.DiagnosticSource (145)
System\Diagnostics\Activity.cs (38)
18/// Carries the <see cref="Activity.Current"/> changed event data. 22internal ActivityChangedEventArgs(Activity? previous, Activity? current) 29/// Gets <see cref="Activity"/> object before the event. 31public Activity? Previous { get; init; } 34/// Gets <see cref="Activity"/> object after the event. 36public Activity? Current { get; init; } 78/// Event occur when the <see cref="Activity.Current"/> value changes. 116private Activity? _previousActiveActivity; 143public Activity SetStatus(ActivityStatusCode code, string? description = null) 186public Activity? Parent { get; private set; } 363for (Activity? activity = this; activity != null; activity = activity.Parent) 373static IEnumerable<KeyValuePair<string, string?>> Iterate(Activity? activity) 459public Activity AddTag(string key, string? value) => AddTag(key, (object?)value); 469public Activity AddTag(string key, object? value) 493public Activity SetTag(string key, object? value) 510public Activity AddEvent(ActivityEvent e) 535public Activity AddException(Exception exception, in TagList tags = default, DateTimeOffset timestamp = default) 598public Activity AddLink(ActivityLink link) 617public Activity AddBaggage(string key, string? value) 641public Activity SetBaggage(string key, string? value) 662public Activity SetParentId(string parentId) 692public Activity SetParentId(ActivityTraceId traceId, ActivitySpanId spanId, ActivityTraceFlags activityTraceFlags = ActivityTraceFlags.None) 722public Activity SetStartTime(DateTime startTimeUtc) 742public Activity SetEndTime(DateTime endTimeUtc) 771/// Use <see cref="DiagnosticSource.StartActivity(Activity, object)"/> to start activity and write start event. 773/// <seealso cref="DiagnosticSource.StartActivity(Activity, object)"/> 775public Activity Start() 827/// Use <see cref="DiagnosticSource.StopActivity(Activity, object)"/> to stop activity and write stop event. 829/// <seealso cref="DiagnosticSource.StopActivity(Activity, object)"/> 872for (Activity? activity = this; activity != null; activity = activity.Parent) 1032public Activity SetIdFormat(ActivityIdFormat format) 1161internal static Activity Create(ActivitySource source, string name, ActivityKind kind, string? parentId, ActivityContext parentContext, 1165Activity activity = new Activity(name); 1378private static bool ValidateSetCurrent(Activity? activity) 1441/// Indicates whether this <see cref="Activity"/> object is stopped 1444/// When subscribing to <see cref="Activity"/> stop event using <see cref="ActivityListener.ActivityStopped"/>, the received <see cref="Activity"/> object in the event callback will have <see cref="IsStopped"/> as true.
System\Diagnostics\Activity.Current.net46.cs (5)
10private static readonly AsyncLocal<Activity?> s_current = new AsyncLocal<Activity?>(); 16public static Activity? Current 28private static void SetCurrent(Activity? activity) 37Activity? previous = s_current.Value;
System\Diagnostics\ActivityContext.cs (2)
78return Activity.TryConvertIdToContext(traceParent, traceState, isRemote, out context); 104if (!Activity.TryConvertIdToContext(traceParent, traceState, isRemote: false, out ActivityContext context))
System\Diagnostics\ActivityCreationOptions.cs (6)
38if (IdFormat == ActivityIdFormat.Unknown && Activity.ForceDefaultIdFormat) 40IdFormat = Activity.DefaultIdFormat; 80IdFormat = Activity.Current != null ? Activity.Current.IdFormat : Activity.DefaultIdFormat; 135Func<ActivityTraceId>? traceIdGenerator = Activity.TraceIdGenerator;
System\Diagnostics\ActivityEvent.cs (5)
15private readonly Activity.TagsLinkedList? _tags; 40_tags = tagsCount > 0 ? new Activity.TagsLinkedList(tags!) : null; 61/// <returns><see cref="Activity.Enumerator{T}"/>.</returns> 62public Activity.Enumerator<KeyValuePair<string, object?>> EnumerateTagObjects() => new Activity.Enumerator<KeyValuePair<string, object?>>(_tags?.First);
System\Diagnostics\ActivityLink.cs (5)
17private readonly Activity.TagsLinkedList? _tags; 28_tags = tags?.Count > 0 ? new Activity.TagsLinkedList(tags) : null; 50/// <returns><see cref="Activity.Enumerator{T}"/>.</returns> 51public Activity.Enumerator<KeyValuePair<string, object?>> EnumerateTagObjects() => new Activity.Enumerator<KeyValuePair<string, object?>>(_tags?.First);
System\Diagnostics\ActivityListener.cs (12)
14/// Define the callback to be used in <see cref="ActivityListener"/> to receive notifications when exceptions are added to the <see cref="Activity"/>. 16public delegate void ExceptionRecorder(Activity activity, Exception exception, ref TagList tags); 24/// Construct a new <see cref="ActivityListener"/> object to start listening to the <see cref="Activity"/> events. 31/// Set or get the callback used to listen to the <see cref="Activity"/> start event. 33public Action<Activity>? ActivityStarted { get; set; } 36/// Set or get the callback used to listen to the <see cref="Activity"/> stop event. 38public Action<Activity>? ActivityStopped { get; set; } 41/// Set or get the callback used to listen to <see cref="Activity"/> events when exceptions are added. 46/// Set or get the callback used to decide if want to listen to <see cref="Activity"/> objects events which created using <see cref="ActivitySource"/> object. 51/// Set or get the callback used to decide allowing creating <see cref="Activity"/> objects with specific data state. 56/// Set or get the callback used to decide allowing creating <see cref="Activity"/> objects with specific data state. 61/// Dispose will unregister this <see cref="ActivityListener"/> object from listening to <see cref="Activity"/> events.
System\Diagnostics\ActivitySource.cs (38)
100/// Creates a new <see cref="Activity"/> object if there is any listener to the Activity, returns null otherwise. 104/// <returns>The created <see cref="Activity"/> object or null if there is no any event listener.</returns> 106/// If the Activity object is created, it will not start automatically. Callers need to call <see cref="Activity.Start()"/> to start it. 108public Activity? CreateActivity(string name, ActivityKind kind) 112/// Creates a new <see cref="Activity"/> object if there is any listener to the Activity, returns null otherwise. 113/// If the Activity object is created, it will not automatically start. Callers will need to call <see cref="Activity.Start()"/> to start it. 121/// <returns>The created <see cref="Activity"/> object or null if there is no any listener.</returns> 123/// If the Activity object is created, it will not start automatically. Callers need to call <see cref="Activity.Start()"/> to start it. 125public Activity? CreateActivity(string name, ActivityKind kind, ActivityContext parentContext, IEnumerable<KeyValuePair<string, object?>>? tags = null, IEnumerable<ActivityLink>? links = null, ActivityIdFormat idFormat = ActivityIdFormat.Unknown) 129/// Creates a new <see cref="Activity"/> object if there is any listener to the Activity, returns null otherwise. 137/// <returns>The created <see cref="Activity"/> object or null if there is no any listener.</returns> 139/// If the Activity object is created, it will not start automatically. Callers need to call <see cref="Activity.Start()"/> to start it. 141public Activity? CreateActivity(string name, ActivityKind kind, string? parentId, IEnumerable<KeyValuePair<string, object?>>? tags = null, IEnumerable<ActivityLink>? links = null, ActivityIdFormat idFormat = ActivityIdFormat.Unknown) 145/// Creates and starts a new <see cref="Activity"/> object if there is any listener to the Activity, returns null otherwise. 149/// <returns>The created <see cref="Activity"/> object or null if there is no any event listener.</returns> 150public Activity? StartActivity([CallerMemberName] string name = "", ActivityKind kind = ActivityKind.Internal) 154/// Creates and starts a new <see cref="Activity"/> object if there is any listener to the Activity events, returns null otherwise. 162/// <returns>The created <see cref="Activity"/> object or null if there is no any listener.</returns> 163public Activity? StartActivity(string name, ActivityKind kind, ActivityContext parentContext, IEnumerable<KeyValuePair<string, object?>>? tags = null, IEnumerable<ActivityLink>? links = null, DateTimeOffset startTime = default) 167/// Creates and starts a new <see cref="Activity"/> object if there is any listener to the Activity events, returns null otherwise. 175/// <returns>The created <see cref="Activity"/> object or null if there is no any listener.</returns> 176public Activity? StartActivity(string name, ActivityKind kind, string? parentId, IEnumerable<KeyValuePair<string, object?>>? tags = null, IEnumerable<ActivityLink>? links = null, DateTimeOffset startTime = default) 180/// Creates and starts a new <see cref="Activity"/> object if there is any listener to the Activity events, returns null otherwise. 188/// <returns>The created <see cref="Activity"/> object or null if there is no any listener.</returns> 189public Activity? StartActivity(ActivityKind kind, ActivityContext parentContext = default, IEnumerable<KeyValuePair<string, object?>>? tags = null, IEnumerable<ActivityLink>? links = null, DateTimeOffset startTime = default, [CallerMemberName] string name = "") 192private Activity? CreateActivity(string name, ActivityKind kind, ActivityContext context, string? parentId, IEnumerable<KeyValuePair<string, object?>>? tags, 202Activity? activity = null; 288bool useCurrentActivityContext = context == default && Activity.Current != null; 289var aco = new ActivityCreationOptions<ActivityContext>(this, name, useCurrentActivityContext ? Activity.Current!.Context : context, kind, tags, links, idFormat); 317activity = Activity.Create(this, name, kind, parentId, context, tags, links, startTime, samplerTags, samplingResult, startIt, idFormat, traceState); 333/// Add a listener to the <see cref="Activity"/> starting and stopping events. 335/// <param name="listener"> The <see cref="ActivityListener"/> object to use for listening to the <see cref="Activity"/> events.</param> 373internal void NotifyActivityStart(Activity activity) 381listeners.EnumWithAction((listener, obj) => listener.ActivityStarted?.Invoke((Activity)obj), activity); 385internal void NotifyActivityStop(Activity activity) 393listeners.EnumWithAction((listener, obj) => listener.ActivityStopped?.Invoke((Activity)obj), activity); 397internal void NotifyActivityAddException(Activity activity, Exception exception, ref TagList tags) 513public void EnumWithExceptionNotification(Activity activity, Exception exception, ref TagList tags)
System\Diagnostics\DiagnosticListener.cs (4)
280internal Action<Activity, object?>? OnActivityImport; 281internal Action<Activity, object?>? OnActivityExport; 431Action<Activity, object?>? onActivityImport, Action<Activity, object?>? onActivityExport)
System\Diagnostics\DiagnosticSourceActivity.cs (17)
19/// was started. Consumers could access <see cref="Activity.Current"/> 27/// <seealso cref="Activity"/> 29public Activity StartActivity(Activity activity, object? args) 39public Activity StartActivity<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties)] T>(Activity activity, T args) 44/// that Activity was stopped. Consumers could access <see cref="Activity.Current"/> 51/// <seealso cref="Activity"/> 53public void StopActivity(Activity activity, object? args) 58activity.SetEndTime(Activity.GetUtcNow()); 66public void StopActivity<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties)] T>(Activity activity, T args) 93public virtual void OnActivityImport(Activity activity, object? payload) { } 119public virtual void OnActivityExport(Activity activity, object? payload) { } 124public override void OnActivityImport(Activity activity, object? payload) 130public override void OnActivityExport(Activity activity, object? payload) 144Action<Activity, object?>? onActivityImport = null, Action<Activity, object?>? onActivityExport = null)
System\Diagnostics\DiagnosticSourceEventSource.cs (4)
893[DynamicDependency(DynamicallyAccessedMemberTypes.PublicProperties, typeof(Activity))] 901private static void OnActivityStarted(DiagnosticSourceEventSource eventSource, Activity activity) 920private static void OnActivityStopped(DiagnosticSourceEventSource eventSource, Activity activity) 1513return Activity.Current;
System\Diagnostics\DistributedContextPropagator.cs (2)
45/// Injects the trace values stored in the <see cref="Activity"/> object into a carrier. For example, into the headers of an HTTP request. 50public abstract void Inject(Activity? activity, object? carrier, PropagatorSetterCallback? setter);
System\Diagnostics\LegacyPropagator.cs (1)
16public override void Inject(Activity? activity, object? carrier, PropagatorSetterCallback? setter)
System\Diagnostics\NoOutputPropagator.cs (1)
14public override void Inject(Activity? activity, object? carrier, PropagatorSetterCallback? setter)
System\Diagnostics\PassThroughPropagator.cs (5)
14public override void Inject(Activity? activity, object? carrier, PropagatorSetterCallback? setter) 46Activity? activity = Activity.Current; 48while (activity?.Parent is Activity parent) 55isW3c = parentId is not null ? Activity.TryConvertIdToContext(parentId, traceState, isRemote: false, out _) : false;
System.Net.Http (6)
System\Net\Http\DiagnosticsHandler.cs (6)
51return Activity.Current != null || 56private static Activity? CreateActivity(HttpRequestMessage requestMessage) 58Activity? activity = null; 66if (Activity.Current is not null || s_diagnosticListener.IsEnabled(DiagnosticsHandlerLoggingStrings.ActivityName, requestMessage)) 112Activity? activity = CreateActivity(request); 308private void InjectHeaders(Activity currentActivity, HttpRequestMessage request)