1 type derived from ActivitySource
Microsoft.Extensions.Diagnostics (1)
Tracing\DefaultActivitySourceFactory.cs (1)
175internal sealed class FactoryActivitySource : ActivitySource
75 instantiations of ActivitySource
aspire (4)
Backchannel\ExtensionBackchannel.cs (1)
57private readonly ActivitySource _activitySource = new(nameof(ExtensionBackchannel));
Telemetry\AspireCliTelemetry.cs (2)
123_reportedActivitySource = new ActivitySource(reportedSourceName); 124_diagnosticsActivitySource = new ActivitySource(diagnosticsSourceName);
Telemetry\ProfilingTelemetry.cs (1)
21private readonly ActivitySource _activitySource = new(ActivitySourceName);
Aspire.Cli.Tests (13)
Commands\AppHostLauncherTests.cs (2)
950using var source = new ActivitySource("test-detached-child-environment"); 1031using var source = new ActivitySource("test-detached-child-environment");
Projects\AppHostServerSessionTests.cs (1)
93using var parentSource = new ActivitySource("test-apphost-server-parent");
Telemetry\AspireCliTelemetryTests.cs (1)
180using var otherSource = new ActivitySource(otherSourceName);
Telemetry\CliTagEnrichmentProcessorTests.cs (3)
20using var source = new ActivitySource($"Test.{Path.GetRandomFileName()}"); 65using var source = new ActivitySource($"Test.{Path.GetRandomFileName()}"); 105using var source = new ActivitySource($"Test.{Path.GetRandomFileName()}");
Telemetry\ProfilingTelemetryContextTests.cs (2)
17using var source = new ActivitySource("test-profiling-context"); 51using var source = new ActivitySource("test-profiling-context");
Telemetry\ProfilingTelemetryTests.cs (3)
290using var parentSource = new ActivitySource("test-parent"); 321using var parentSource = new ActivitySource("test-parent"); 323using var diagnosticSource = new ActivitySource("test-diagnostic");
Telemetry\TelemetryConfigurationTests.cs (1)
243using var source = new ActivitySource("test-detached-non-profiling-context");
Aspire.Confluent.Kafka (1)
src\Vendoring\OpenTelemetry.Instrumentation.ConfluentKafka\ConfluentKafkaCommon.cs (1)
20internal static readonly ActivitySource ActivitySource = new(InstrumentationName, InstrumentationVersion);
Aspire.Dashboard (2)
DashboardActivitySource.cs (1)
21public ActivitySource ActivitySource { get; } = new(ActivitySourceName);
ServiceClient\DashboardSqliteDatabase.cs (1)
25private readonly ActivitySource _activitySource = new(TracingSqliteConnection.ActivitySourceName);
Aspire.Dashboard.Tests (1)
Integration\HealthTests.cs (1)
87internal ActivitySource TestActivitySource { get; } = new(TestActivitySourceName);
Aspire.Hosting (1)
Diagnostics\ProfilingTelemetry.cs (1)
198private static readonly ActivitySource s_activitySource = new(ActivitySourceName);
Aspire.Hosting.RemoteHost (1)
Diagnostics\RemoteHostProfilingTelemetry.cs (1)
18private readonly ActivitySource _activitySource = new(ActivitySourceName);
Aspire.Hosting.RemoteHost.Tests (3)
RemoteHostProfilingTelemetryTests.cs (3)
18using var parentSource = new ActivitySource("test-remotehost-parent"); 165using var clientSource = new ActivitySource("test.client"); 166using var jsonRpcSource = new ActivitySource("test.jsonrpc");
Aspire.Hosting.Tests (5)
Backchannel\AuxiliaryBackchannelRpcTargetTests.cs (2)
2228using var clientSource = new ActivitySource("test.client"); 2229using var jsonRpcSource = new ActivitySource("test.jsonrpc");
Backchannel\BackchannelContractTests.cs (3)
249using var source = new ActivitySource("test-json-rpc-trace"); 302using var processSource = new ActivitySource("test.process"); 311using var ambientSource = new ActivitySource("test.ambient");
Aspire.RabbitMQ.Client (1)
AspireRabbitMQExtensions.cs (1)
26private static readonly ActivitySource s_activitySource = new ActivitySource(ActivitySourceName);
Aspire.StackExchange.Redis (1)
src\Vendoring\OpenTelemetry.Instrumentation.StackExchangeRedis\Shared\ActivitySourceFactory.cs (1)
58return new(options);
Aspire.TerminalHost (1)
TerminalHostTelemetry.cs (1)
37public static readonly ActivitySource ActivitySource = new(SourceName);
CatalogDb (1)
CatalogDbInitializer.cs (1)
11private readonly ActivitySource _activitySource = new(ActivitySourceName);
DatabaseMigration.MigrationService (1)
ApiDbInitializer.cs (1)
18private static readonly ActivitySource s_activitySource = new(ActivitySourceName);
Microsoft.AspNetCore.Components (1)
ComponentsActivitySource.cs (1)
19private static ActivitySource ActivitySource { get; } = new ActivitySource(Name);
Microsoft.AspNetCore.Components.Server (1)
Circuits\CircuitActivitySource.cs (1)
16private static ActivitySource ActivitySource { get; } = new ActivitySource(Name);
Microsoft.AspNetCore.Hosting (3)
GenericHost\GenericWebHostBuilder.cs (1)
76services.TryAddSingleton(sp => new ActivitySource("Microsoft.AspNetCore"));
GenericHost\SlimWebHostBuilder.cs (1)
50services.TryAddSingleton(sp => new ActivitySource("Microsoft.AspNetCore"));
WebHostBuilder.cs (1)
290services.TryAddSingleton(sp => new ActivitySource("Microsoft.AspNetCore"));
Microsoft.AspNetCore.SignalR.Client.Core (1)
Internal\SignalRClientActivitySource.cs (1)
15public ActivitySource ActivitySource { get; } = new ActivitySource("Microsoft.AspNetCore.SignalR.Client");
Microsoft.AspNetCore.SignalR.Core (1)
Internal\SignalRServerActivitySource.cs (1)
19public ActivitySource ActivitySource { get; } = new ActivitySource(Name);
Microsoft.Build.Framework (1)
Telemetry\MSBuildActivitySource.cs (1)
30_source = new ActivitySource(name);
Microsoft.DotNet.Cli.Utils (1)
Activities.cs (1)
18public static ActivitySource Source { get; } = new("dotnet-cli", Product.Version);
Microsoft.Extensions.AI (7)
ChatCompletion\OpenTelemetryChatClient.cs (1)
70_activitySource = new(name);
ChatCompletion\OpenTelemetryImageGenerator.cs (1)
62_activitySource = new(name);
Embeddings\OpenTelemetryEmbeddingGenerator.cs (1)
66_activitySource = new(name);
Files\OpenTelemetryHostedFileClient.cs (1)
82_activitySource = new(name);
Realtime\OpenTelemetryRealtimeClientSession.cs (1)
120_activitySource = new(name);
SpeechToText\OpenTelemetrySpeechToTextClient.cs (1)
64_activitySource = new(name);
TextToSpeech\OpenTelemetryTextToSpeechClient.cs (1)
63_activitySource = new(name);
Microsoft.Extensions.AI.Tests (6)
ChatCompletion\FunctionInvokingChatClientTests.cs (5)
1703using (var agentSource = new ActivitySource(agentSourceName)) 1757using var agentSource = new ActivitySource(agentSourceName); 1814using (var agentSource = new ActivitySource(agentSourceName)) 1856using (var agentSource = new ActivitySource(agentSourceName)) 1903using (var agentSource = new ActivitySource(agentSourceName))
ChatCompletion\OpenTelemetryChatClientTests.cs (1)
1079using var parentSource = new ActivitySource(Guid.NewGuid().ToString());
Microsoft.Extensions.DataIngestion (1)
IngestionPipeline.cs (1)
51_activitySource = new((options ?? new()).ActivitySourceName);
Microsoft.Extensions.ServiceDiscovery.Dns (1)
Resolver\DnsResolver.Telemetry.cs (1)
56private static readonly ActivitySource s_activitySource = new ActivitySource(ActivitySourceName);
Seq.ApiService (1)
Program.cs (1)
13ActivitySource source = new("MyApp.Source");
Stress.ApiService (8)
ProducerConsumer.cs (1)
22private static readonly ActivitySource s_activitySource = new(ActivitySourceName);
Program.cs (6)
420ActivitySource source = new("Services.Api", "1.0.0"); 474var source = new ActivitySource("Services.Api", "1.0.0"); 770var source = new ActivitySource("Services.Api", "1.0.0"); 789var source = new ActivitySource("Services.Api", "1.0.0"); 828var source = new ActivitySource("Services.Api", "1.0.0"); 909var source = new ActivitySource("Services.Api", "1.0.0");
TraceCreator.cs (1)
15private static readonly ActivitySource s_activitySource = new(ActivitySourceName);
System.Diagnostics.DiagnosticSource (1)
System\Diagnostics\Activity.cs (1)
67private static readonly ActivitySource s_defaultSource = new ActivitySource(string.Empty);
System.Net.Http (2)
System\Net\Http\DiagnosticsHandler.cs (1)
19internal static readonly ActivitySource s_activitySource = new ActivitySource(DiagnosticsHandlerLoggingStrings.RequestNamespace);
System\Net\Http\SocketsHttpHandler\ConnectionPool\ConnectionSetupDistributedTracing.cs (1)
13private static readonly ActivitySource s_connectionsActivitySource = new ActivitySource(DiagnosticsHandlerLoggingStrings.ConnectionsNamespace);
System.Net.NameResolution (1)
System\Net\NameResolutionTelemetry.cs (1)
163private static readonly ActivitySource s_activitySource = new ActivitySource(ActivitySourceName);
System.Net.Security (1)
System\Net\Security\NetSecurityTelemetry.cs (1)
18private static readonly ActivitySource s_activitySource = new ActivitySource(ActivitySourceName);
System.Net.Sockets (1)
System\Net\Sockets\SocketsTelemetry.cs (1)
15private static readonly ActivitySource s_connectActivitySource = new ActivitySource(ActivitySourceName);
222 references to ActivitySource
aspire (7)
Backchannel\ExtensionBackchannel.cs (1)
57private readonly ActivitySource _activitySource = new(nameof(ExtensionBackchannel));
Telemetry\AspireCliTelemetry.cs (4)
47private readonly ActivitySource _diagnosticsActivitySource; 48private readonly ActivitySource _reportedActivitySource; 176private static Activity? StartActivityCore(ActivitySource source, string name, ActivityKind kind) 181private static Activity? StartActivityCore(ActivitySource source, string name, ActivityKind kind, ActivityContext? parentContext)
Telemetry\ProfilingTelemetry.cs (2)
21private readonly ActivitySource _activitySource = new(ActivitySourceName); 23internal ActivitySource ActivitySource => _activitySource;
Aspire.Cli.Tests (21)
Commands\AgentTelemetryCommandTests.cs (1)
275ActivitySource.AddActivityListener(listener);
Commands\AppHostLauncherTests.cs (2)
950using var source = new ActivitySource("test-detached-child-environment"); 1031using var source = new ActivitySource("test-detached-child-environment");
Projects\AppHostServerSessionTests.cs (1)
93using var parentSource = new ActivitySource("test-apphost-server-parent");
Telemetry\AspireCliTelemetryTests.cs (3)
171ActivitySource.AddActivityListener(otherListener); 180using var otherSource = new ActivitySource(otherSourceName); 597ActivitySource.AddActivityListener(listener);
Telemetry\CliTagEnrichmentProcessorTests.cs (6)
20using var source = new ActivitySource($"Test.{Path.GetRandomFileName()}"); 26ActivitySource.AddActivityListener(listener); 65using var source = new ActivitySource($"Test.{Path.GetRandomFileName()}"); 71ActivitySource.AddActivityListener(listener); 105using var source = new ActivitySource($"Test.{Path.GetRandomFileName()}"); 111ActivitySource.AddActivityListener(listener);
Telemetry\ProfilingTelemetryContextTests.cs (2)
17using var source = new ActivitySource("test-profiling-context"); 51using var source = new ActivitySource("test-profiling-context");
Telemetry\ProfilingTelemetryTests.cs (3)
290using var parentSource = new ActivitySource("test-parent"); 321using var parentSource = new ActivitySource("test-parent"); 323using var diagnosticSource = new ActivitySource("test-diagnostic");
Telemetry\TelemetryConfigurationTests.cs (2)
243using var source = new ActivitySource("test-detached-non-profiling-context"); 385ActivitySource.AddActivityListener(listener);
Telemetry\TelemetryFixture.cs (1)
78ActivitySource.AddActivityListener(_listener);
Aspire.Confluent.Kafka (1)
src\Vendoring\OpenTelemetry.Instrumentation.ConfluentKafka\ConfluentKafkaCommon.cs (1)
20internal static readonly ActivitySource ActivitySource = new(InstrumentationName, InstrumentationVersion);
Aspire.Dashboard (11)
DashboardActivitySource.cs (1)
21public ActivitySource ActivitySource { get; } = new(ActivitySourceName);
Model\ResourceOutgoingPeerResolver.cs (1)
27private readonly ActivitySource _activitySource;
Model\TelemetryImportService.cs (1)
24private readonly ActivitySource _activitySource;
Otlp\Storage\SqliteTelemetryRepository.cs (1)
46internal ActivitySource SqlActivitySource => _database.ActivitySource;
ServiceClient\DashboardClient.cs (1)
55private readonly ActivitySource _activitySource;
ServiceClient\DashboardSqliteDatabase.cs (2)
25private readonly ActivitySource _activitySource = new(TracingSqliteConnection.ActivitySourceName); 66internal ActivitySource ActivitySource => _activitySource;
ServiceClient\TracingSqliteConnection.cs (4)
18internal sealed class TracingSqliteConnection(string connectionString, string databasePath, ActivitySource activitySource) : SqliteConnection(connectionString) 76private static Activity? StartActivity(string query, string databaseName, ActivitySource activitySource) 140internal sealed class TracingSqliteTransaction(SqliteTransaction transaction, string databaseName, ActivitySource activitySource) : DbTransaction 216private sealed class TracingDbCommand(DbCommand command, string databaseName, ActivitySource activitySource) : DbCommand
Aspire.Dashboard.Tests (2)
Integration\HealthTests.cs (1)
87internal ActivitySource TestActivitySource { get; } = new(TestActivitySourceName);
Model\SqliteResourceRepositoryTests.cs (1)
951ActivitySource.AddActivityListener(listener);
Aspire.Hosting (2)
Diagnostics\ProfilingTelemetry.cs (2)
198private static readonly ActivitySource s_activitySource = new(ActivitySourceName); 200internal static ActivitySource ActivitySource => s_activitySource;
Aspire.Hosting.RemoteHost (2)
Diagnostics\RemoteHostProfilingTelemetry.cs (2)
18private readonly ActivitySource _activitySource = new(ActivitySourceName); 20internal ActivitySource ActivitySource => _activitySource;
Aspire.Hosting.RemoteHost.Tests (4)
RemoteHostProfilingTelemetryTests.cs (4)
18using var parentSource = new ActivitySource("test-remotehost-parent"); 164ActivitySource.AddActivityListener(listener); 165using var clientSource = new ActivitySource("test.client"); 166using var jsonRpcSource = new ActivitySource("test.jsonrpc");
Aspire.Hosting.Tests (7)
Backchannel\AuxiliaryBackchannelRpcTargetTests.cs (3)
2218ActivitySource.AddActivityListener(listener); 2228using var clientSource = new ActivitySource("test.client"); 2229using var jsonRpcSource = new ActivitySource("test.jsonrpc");
Backchannel\BackchannelContractTests.cs (3)
249using var source = new ActivitySource("test-json-rpc-trace"); 302using var processSource = new ActivitySource("test.process"); 311using var ambientSource = new ActivitySource("test.ambient");
DistributedApplicationTests.cs (1)
2457ActivitySource.AddActivityListener(listener);
Aspire.RabbitMQ.Client (1)
AspireRabbitMQExtensions.cs (1)
26private static readonly ActivitySource s_activitySource = new ActivitySource(ActivitySourceName);
Aspire.StackExchange.Redis (15)
src\Vendoring\OpenTelemetry.Instrumentation.StackExchangeRedis\Implementation\RedisProfilerEntryToActivityConverter.cs (1)
97var activitySource =
src\Vendoring\OpenTelemetry.Instrumentation.StackExchangeRedis\Shared\ActivitySourceFactory.cs (11)
12/// Creates a new <see cref="ActivitySource"/> for the assembly associated 15/// <typeparam name="T">The type for which the <see cref="ActivitySource"/> is created for its assembly.</typeparam> 17/// <param name="tags">The optional tags to associate with the created <see cref="ActivitySource"/>.</param> 18/// <returns>A new <see cref="ActivitySource"/> instance.</returns> 19public static ActivitySource Create<T>(Version? semanticConventionsVersion, IEnumerable<KeyValuePair<string, object?>>? tags = null) 23/// Creates a new <see cref="ActivitySource"/> for the assembly associated 26/// <param name="type">The type for which the <see cref="ActivitySource"/> is created for its assembly.</param> 28/// <param name="tags">The optional tags to associate with the created <see cref="ActivitySource"/>.</param> 29/// <param name="name">The optional name to use for the <see cref="ActivitySource"/> instead of the assembly name associated with <paramref name="type"/>.</param> 30/// <returns>A new <see cref="ActivitySource"/> instance.</returns> 31public static ActivitySource Create(Type type, Version? semanticConventionsVersion, IEnumerable<KeyValuePair<string, object?>>? tags = null, string? name = null)
src\Vendoring\OpenTelemetry.Instrumentation.StackExchangeRedis\StackExchangeRedisConnectionInstrumentation.cs (3)
23internal static readonly ActivitySource ActivitySource = ActivitySourceFactory.Create(typeof(StackExchangeRedisConnectionInstrumentation), SemanticConventionsVersion, name: ActivitySourceName); 26internal static readonly ActivitySource ActivitySourceNew = ActivitySourceFactory.Create(typeof(StackExchangeRedisConnectionInstrumentation), SemanticConventionsVersionNew, name: ActivitySourceName); 28internal static readonly ActivitySource ActivitySourceBoth = ActivitySourceFactory.Create(typeof(StackExchangeRedisConnectionInstrumentation), null, name: ActivitySourceName);
Aspire.TerminalHost (2)
TerminalHostTelemetry.cs (2)
10/// Shared <see cref="System.Diagnostics.ActivitySource"/> and <see cref="System.Diagnostics.Metrics.Meter"/> 37public static readonly ActivitySource ActivitySource = new(SourceName);
Aspire.TestUtilities (3)
ActivityListenerHelper.cs (3)
10/// specific <see cref="ActivitySource"/>. Using instance-based filtering (via 20public static ActivityListener Create(ActivitySource targetSource, Action<Activity>? onActivityStarted = null, Action<Activity>? onActivityStopped = null) 29ActivitySource.AddActivityListener(listener);
CatalogDb (1)
CatalogDbInitializer.cs (1)
11private readonly ActivitySource _activitySource = new(ActivitySourceName);
DatabaseMigration.MigrationService (1)
ApiDbInitializer.cs (1)
18private static readonly ActivitySource s_activitySource = new(ActivitySourceName);
Microsoft.AspNetCore.Components (1)
ComponentsActivitySource.cs (1)
19private static ActivitySource ActivitySource { get; } = new ActivitySource(Name);
Microsoft.AspNetCore.Components.Server (1)
Circuits\CircuitActivitySource.cs (1)
16private static ActivitySource ActivitySource { get; } = new ActivitySource(Name);
Microsoft.AspNetCore.Diagnostics (2)
src\aspnetcore\src\Shared\Diagnostics\ActivityCreator.cs (2)
10public static bool IsActivityCreated(ActivitySource activitySource, bool diagnosticsOrLoggingEnabled) 19ActivitySource activitySource,
Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore (2)
src\aspnetcore\src\Shared\Diagnostics\ActivityCreator.cs (2)
10public static bool IsActivityCreated(ActivitySource activitySource, bool diagnosticsOrLoggingEnabled) 19ActivitySource activitySource,
Microsoft.AspNetCore.Hosting (12)
GenericHost\GenericWebHostService.cs (2)
23ActivitySource activitySource, 53public ActivitySource ActivitySource { get; }
Internal\HostingApplication.cs (1)
38ActivitySource activitySource,
Internal\HostingApplicationDiagnostics.cs (2)
31private readonly ActivitySource _activitySource; 47ActivitySource activitySource,
Internal\WebHost.cs (2)
142var activitySource = _applicationServices.GetRequiredService<ActivitySource>();
src\aspnetcore\src\Shared\Diagnostics\ActivityCreator.cs (2)
10public static bool IsActivityCreated(ActivitySource activitySource, bool diagnosticsOrLoggingEnabled) 19ActivitySource activitySource,
WebHostBuilder.cs (3)
360var activitySource = hostingServiceProvider.GetService<ActivitySource>(); 361services.Replace(ServiceDescriptor.Singleton(typeof(ActivitySource), activitySource!));
Microsoft.AspNetCore.SignalR.Client.Core (2)
HubConnection.cs (1)
79private readonly ActivitySource _activitySource;
Internal\SignalRClientActivitySource.cs (1)
15public ActivitySource ActivitySource { get; } = new ActivitySource("Microsoft.AspNetCore.SignalR.Client");
Microsoft.AspNetCore.SignalR.Core (4)
Internal\DefaultHubDispatcher.cs (1)
952var activitySource = serviceProvider.GetService<SignalRServerActivitySource>()?.ActivitySource;
Internal\SignalRServerActivitySource.cs (1)
19public ActivitySource ActivitySource { get; } = new ActivitySource(Name);
src\aspnetcore\src\Shared\Diagnostics\ActivityCreator.cs (2)
10public static bool IsActivityCreated(ActivitySource activitySource, bool diagnosticsOrLoggingEnabled) 19ActivitySource activitySource,
Microsoft.Build.Framework (1)
Telemetry\MSBuildActivitySource.cs (1)
26private readonly ActivitySource _source;
Microsoft.DotNet.Cli.Utils (1)
Activities.cs (1)
18public static ActivitySource Source { get; } = new("dotnet-cli", Product.Version);
Microsoft.Extensions.AI (23)
ChatCompletion\FunctionInvokingChatClient.cs (3)
78/// <summary>The <see cref="ActivitySource"/> to use for telemetry.</summary> 80private readonly ActivitySource? _activitySource; 92_activitySource = innerClient.GetService<ActivitySource>();
ChatCompletion\OpenTelemetryChatClient.cs (2)
33private readonly ActivitySource _activitySource; 131serviceType == typeof(ActivitySource) ? _activitySource :
ChatCompletion\OpenTelemetryImageGenerator.cs (2)
29private readonly ActivitySource _activitySource; 100serviceType == typeof(ActivitySource) ? _activitySource :
Common\FunctionInvocationProcessor.cs (3)
24private readonly ActivitySource? _activitySource; 41ActivitySource? activitySource, 158ActivitySource? source = invokeAgentActivity?.Source ?? _activitySource;
Embeddings\OpenTelemetryEmbeddingGenerator.cs (2)
29private readonly ActivitySource _activitySource; 92serviceType == typeof(ActivitySource) ? _activitySource :
Files\OpenTelemetryHostedFileClient.cs (2)
53private readonly ActivitySource _activitySource; 119serviceKey is null && serviceType == typeof(ActivitySource) ? _activitySource :
Realtime\FunctionInvokingRealtimeClientSession.cs (3)
66/// <summary>The <see cref="ActivitySource"/> to use for telemetry.</summary> 68private readonly ActivitySource? _activitySource; 88_activitySource = innerSession.GetService<ActivitySource>();
Realtime\OpenTelemetryRealtimeClientSession.cs (2)
85private readonly ActivitySource _activitySource; 170serviceType == typeof(ActivitySource) ? _activitySource :
SpeechToText\OpenTelemetrySpeechToTextClient.cs (2)
31private readonly ActivitySource _activitySource; 102serviceType == typeof(ActivitySource) ? _activitySource :
TextToSpeech\OpenTelemetryTextToSpeechClient.cs (2)
30private readonly ActivitySource _activitySource; 101serviceType == typeof(ActivitySource) ? _activitySource :
Microsoft.Extensions.AI.OpenAI.Tests (2)
OpenAIChatClientTests.cs (1)
2027ActivitySource.AddActivityListener(listener);
OpenAIResponseClientTests.cs (1)
6809ActivitySource.AddActivityListener(listener);
Microsoft.Extensions.AI.Tests (11)
ChatCompletion\FunctionInvokingChatClientTests.cs (5)
1703using (var agentSource = new ActivitySource(agentSourceName)) 1757using var agentSource = new ActivitySource(agentSourceName); 1814using (var agentSource = new ActivitySource(agentSourceName)) 1856using (var agentSource = new ActivitySource(agentSourceName)) 1903using (var agentSource = new ActivitySource(agentSourceName))
ChatCompletion\OpenTelemetryChatClientTests.cs (2)
1079using var parentSource = new ActivitySource(Guid.NewGuid().ToString()); 1085ActivitySource.AddActivityListener(listener);
Files\OpenTelemetryHostedFileClientTests.cs (2)
347var activitySource = client.GetService<ActivitySource>();
Realtime\OpenTelemetryRealtimeClientTests.cs (2)
370var activitySource = session.GetService(typeof(ActivitySource)); 372Assert.IsType<ActivitySource>(activitySource);
Microsoft.Extensions.DataIngestion (2)
IngestionPipeline.cs (1)
30private readonly ActivitySource _activitySource;
IngestionPipelineOptions.cs (1)
18/// Gets or sets the name of the <see cref="ActivitySource"/> used for diagnostics.
Microsoft.Extensions.Diagnostics (8)
Tracing\Configuration\TracingBuilderConfigurationExtensions.cs (2)
19/// which <see cref="ActivitySource"/> and <see cref="Activity"/> instances are enabled. 22/// <para>Tracing has two key levels: <see cref="ActivitySource.Name"/> and <see cref="Activity.OperationName"/>.</para>
Tracing\DefaultActivitySourceFactory.cs (6)
48protected override ActivitySource CreateCore(ActivitySourceOptions options) 61if (TryGetCachedMatch(options, out ActivitySource? cached)) 80if (TryGetCachedMatch(options, out ActivitySource? winner)) 105private bool TryGetCachedMatch(ActivitySourceOptions options, [NotNullWhen(true)] out ActivitySource? match) 324private bool IsEnabledFast(ListenerState state, ActivitySource source, string operationName) 377private bool ShouldListenTo(ActivitySource activitySource)
Microsoft.Extensions.Diagnostics.Abstractions (14)
Tracing\ActivityListenerBuilder.cs (1)
12/// constructs the underlying <see cref="ActivityListener"/>; subscription to <see cref="ActivitySource"/>
Tracing\ActivitySourceScopes.cs (3)
10/// via <see cref="System.Diagnostics.ActivitySource"/> constructors (<see cref="Global"/>) and those created via 22/// Indicates <see cref="System.Diagnostics.ActivitySource"/> instances created via constructors. 27/// Indicates <see cref="System.Diagnostics.ActivitySource"/> instances created via <see cref="System.Diagnostics.ActivitySourceFactory"/>.
Tracing\ITracingBuilder.cs (1)
10/// rules to determine which <see cref="System.Diagnostics.ActivitySource"/> and <see cref="System.Diagnostics.Activity"/>
Tracing\TracingBuilderExtensions.Listeners.cs (2)
28/// Subscription to <see cref="ActivitySource"/> instances is driven entirely by the configuration-based 59/// Subscription to <see cref="ActivitySource"/> instances is driven entirely by the configuration-based
Tracing\TracingBuilderExtensions.Rules.cs (4)
19/// <param name="sourceName">The <see cref="ActivitySource.Name"/>, prefix, or pattern with a single <c>*</c> wildcard. A <see langword="null"/> or empty value matches all activity sources.</param> 31/// <param name="sourceName">The <see cref="ActivitySource.Name"/>, prefix, or pattern with a single <c>*</c> wildcard. A <see langword="null"/> or empty value matches all activity sources.</param> 43/// <param name="sourceName">The <see cref="ActivitySource.Name"/>, prefix, or pattern with a single <c>*</c> wildcard. A <see langword="null"/> or empty value matches all activity sources.</param> 55/// <param name="sourceName">The <see cref="ActivitySource.Name"/>, prefix, or pattern with a single <c>*</c> wildcard. A <see langword="null"/> or empty value matches all activity sources.</param>
Tracing\TracingRule.cs (3)
19/// <item><description>SourceName, either an exact match, the longest prefix match, or a wildcard pattern using a single <c>*</c>. See <see cref="ActivitySource.Name"/>.</description></item> 30/// <param name="sourceName">The <see cref="ActivitySource.Name"/>, prefix, or pattern with a single <c>*</c> wildcard. A <see langword="null"/> or empty value matches all activity sources.</param> 64/// Gets the <see cref="ActivitySource.Name"/>, either an exact match, the longest prefix match, or a wildcard pattern using a single <c>*</c>.
Microsoft.Extensions.ServiceDiscovery.Dns (1)
Resolver\DnsResolver.Telemetry.cs (1)
56private static readonly ActivitySource s_activitySource = new ActivitySource(ActivitySourceName);
Seq.ApiService (1)
Program.cs (1)
13ActivitySource source = new("MyApp.Source");
Stress.ApiService (10)
ProducerConsumer.cs (1)
22private static readonly ActivitySource s_activitySource = new(ActivitySourceName);
Program.cs (8)
420ActivitySource source = new("Services.Api", "1.0.0"); 421ActivitySource.AddActivityListener(new ActivityListener 474var source = new ActivitySource("Services.Api", "1.0.0"); 770var source = new ActivitySource("Services.Api", "1.0.0"); 789var source = new ActivitySource("Services.Api", "1.0.0"); 828var source = new ActivitySource("Services.Api", "1.0.0"); 900async Task SimulateWorkAsync(ActivitySource source, int index, int millisecondsDelay = 2) 909var source = new ActivitySource("Services.Api", "1.0.0");
TraceCreator.cs (1)
15private static readonly ActivitySource s_activitySource = new(ActivitySourceName);
System.Diagnostics.DiagnosticSource (39)
System\Diagnostics\Activity.cs (4)
67private static readonly ActivitySource s_defaultSource = new ActivitySource(string.Empty); 198public ActivitySource Source { get; private set; } 1189internal static Activity Create(ActivitySource source, string name, ActivityKind kind, string? parentId, ActivityContext parentContext, 2283public ActivitySource Source => activity.Source;
System\Diagnostics\ActivityCreationOptions.cs (4)
21/// <param name="source">The trace Activity source<see cref="ActivitySource"/> used to request creating the Activity object.</param> 28internal ActivityCreationOptions(ActivitySource source, string name, T parent, ActivityKind kind, IEnumerable<KeyValuePair<string, object?>>? tags, IEnumerable<ActivityLink>? links, ActivityIdFormat idFormat) 86/// Retrieve the <see cref="ActivitySource"/> object. 88public ActivitySource Source { get; }
System\Diagnostics\ActivityListener.cs (5)
49/// 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. 51public Func<ActivitySource, bool>? ShouldListenTo { get; set; } 66/// Re-evaluates <see cref="ShouldListenTo"/> against every registered <see cref="ActivitySource"/>, attaching this 84ActivitySource.ResetSourceFilters(this); 101ActivitySource.DetachListener(this);
System\Diagnostics\ActivitySource.cs (8)
15private static readonly SynchronizedList<ActivitySource> s_activeSources = new SynchronizedList<ActivitySource>(); 68Func<ActivitySource, bool>? shouldListenTo = listener.ShouldListenTo; 71var activitySource = (ActivitySource)source; 90((ActivitySource)source).RemoveListener(listener); 412/// <param name="listener">The <see cref="ActivityListener"/> instance whose configuration, in particular its <see cref="ActivityListener.ShouldListenTo"/> callback, determines which <see cref="ActivitySource"/> instances it should listen to.</param> 634public void EnumWithFunc<TParent>(ActivitySource.Function<T, TParent> func, ref ActivityCreationOptions<TParent> data, ref ActivitySamplingResult samplingResult, ref ActivityCreationOptions<ActivityContext> dataWithContext)
System\Diagnostics\ActivitySourceFactory.cs (15)
9/// A factory for creating <see cref="ActivitySource"/> instances. 19/// Creates an <see cref="ActivitySource"/> using the supplied <paramref name="options"/>. 22/// <returns>An <see cref="ActivitySource"/> configured with the supplied <paramref name="options"/>.</returns> 32public ActivitySource Create(ActivitySourceOptions options) 53/// Creates an <see cref="ActivitySource"/> with the specified <paramref name="name"/>, <paramref name="version"/>, and <paramref name="tags"/>. 55/// <param name="name">The name of the <see cref="ActivitySource"/>.</param> 56/// <param name="version">The version of the <see cref="ActivitySource"/>.</param> 57/// <param name="tags">The tags to associate with the <see cref="ActivitySource"/>.</param> 58/// <returns>An <see cref="ActivitySource"/> with the specified <paramref name="name"/>, <paramref name="version"/>, and <paramref name="tags"/>.</returns> 59public ActivitySource Create(string name, string? version = "", IEnumerable<KeyValuePair<string, object?>>? tags = null) 71/// When overridden in a derived class, creates the <see cref="ActivitySource"/> for the supplied <paramref name="options"/>. 75/// <returns>An <see cref="ActivitySource"/> configured with the supplied <paramref name="options"/>.</returns> 78/// <see cref="ActivitySource"/>. The supplied <paramref name="options"/> have already been validated and the 80/// should forward the options to the <see cref="ActivitySource"/> constructor unchanged. 82protected abstract ActivitySource CreateCore(ActivitySourceOptions options);
System\Diagnostics\ActivitySourceOptions.cs (2)
9/// Options for creating a <see cref="ActivitySource"/>. 44/// The optional opaque object to attach to the <see cref="ActivitySource"/>. The scope object can be attached
System\Diagnostics\DsesActivitySourceListener.cs (1)
132ActivitySource.AddActivityListener(_activityListener);
System.Net.Http (2)
System\Net\Http\DiagnosticsHandler.cs (1)
19internal static readonly ActivitySource s_activitySource = new ActivitySource(DiagnosticsHandlerLoggingStrings.RequestNamespace);
System\Net\Http\SocketsHttpHandler\ConnectionPool\ConnectionSetupDistributedTracing.cs (1)
13private static readonly ActivitySource s_connectionsActivitySource = new ActivitySource(DiagnosticsHandlerLoggingStrings.ConnectionsNamespace);
System.Net.NameResolution (1)
System\Net\NameResolutionTelemetry.cs (1)
163private static readonly ActivitySource s_activitySource = new ActivitySource(ActivitySourceName);
System.Net.Security (1)
System\Net\Security\NetSecurityTelemetry.cs (1)
18private static readonly ActivitySource s_activitySource = new ActivitySource(ActivitySourceName);
System.Net.Sockets (1)
System\Net\Sockets\SocketsTelemetry.cs (1)
15private static readonly ActivitySource s_connectActivitySource = new ActivitySource(ActivitySourceName);