4 instantiations of ActivityContext
Stress.ApiService (1)
TraceCreator.cs (1)
133
activityContext = new
ActivityContext
(
System.Diagnostics.DiagnosticSource (3)
System\Diagnostics\Activity.cs (2)
778
public ActivityContext Context => new
ActivityContext
(TraceId, SpanId, ActivityTraceFlags, TraceStateString);
1100
context = new
ActivityContext
(
System\Diagnostics\ActivityCreationOptions.cs (1)
139
Unsafe.AsRef(in _context) = new
ActivityContext
(id, default, ActivityTraceFlags.None);
97 references to ActivityContext
Aspire.Microsoft.Data.SqlClient (1)
src\Vendoring\OpenTelemetry.Instrumentation.SqlClient\Implementation\SqlClientDiagnosticListener.cs (1)
59
default(
ActivityContext
),
Aspire.Microsoft.EntityFrameworkCore.SqlServer (1)
src\Vendoring\OpenTelemetry.Instrumentation.SqlClient\Implementation\SqlClientDiagnosticListener.cs (1)
59
default(
ActivityContext
),
Microsoft.AspNetCore.Diagnostics (2)
src\Shared\Diagnostics\ActivityCreator.cs (2)
36
if (
ActivityContext
.TryParse(requestId, traceState, isRemote: true, out
ActivityContext
context))
Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore (2)
src\Shared\Diagnostics\ActivityCreator.cs (2)
36
if (
ActivityContext
.TryParse(requestId, traceState, isRemote: true, out
ActivityContext
context))
Microsoft.AspNetCore.Hosting (2)
src\Shared\Diagnostics\ActivityCreator.cs (2)
36
if (
ActivityContext
.TryParse(requestId, traceState, isRemote: true, out
ActivityContext
context))
Microsoft.AspNetCore.Hosting.Tests (6)
HostingApplicationDiagnosticsTests.cs (4)
180
Sample = (ref ActivityCreationOptions<
ActivityContext
> _) => ActivitySamplingResult.AllData
953
Sample = (ref ActivityCreationOptions<
ActivityContext
> options) => ComputeActivitySamplingResult(ref options),
977
static ActivitySamplingResult ComputeActivitySamplingResult(ref ActivityCreationOptions<
ActivityContext
> options)
1023
Sample = (ref ActivityCreationOptions<
ActivityContext
> _) => ActivitySamplingResult.AllData,
HostingApplicationTests.cs (2)
101
Sample = (ref ActivityCreationOptions<
ActivityContext
> _) => ActivitySamplingResult.AllData
143
Sample = (ref ActivityCreationOptions<
ActivityContext
> _) => ActivitySamplingResult.AllData
Microsoft.AspNetCore.SignalR.Client.FunctionalTests (6)
HubConnectionTests.Tracing.cs (6)
43
Sample = (ref ActivityCreationOptions<
ActivityContext
> _) => ActivitySamplingResult.AllData,
238
Sample = (ref ActivityCreationOptions<
ActivityContext
> _) => ActivitySamplingResult.AllData,
382
Sample = (ref ActivityCreationOptions<
ActivityContext
> _) => ActivitySamplingResult.AllData,
485
Sample = (ref ActivityCreationOptions<
ActivityContext
> _) => ActivitySamplingResult.AllData,
581
Sample = (ref ActivityCreationOptions<
ActivityContext
> _) => ActivitySamplingResult.AllData,
671
Sample = (ref ActivityCreationOptions<
ActivityContext
> _) => ActivitySamplingResult.AllData,
Microsoft.AspNetCore.SignalR.Client.Tests (5)
HubConnectionTests.Tracing.cs (5)
30
Sample = (ref ActivityCreationOptions<
ActivityContext
> _) => ActivitySamplingResult.AllData,
67
Sample = (ref ActivityCreationOptions<
ActivityContext
> _) => ActivitySamplingResult.AllData,
105
Sample = (ref ActivityCreationOptions<
ActivityContext
> _) => ActivitySamplingResult.AllData,
139
Sample = (ref ActivityCreationOptions<
ActivityContext
> _) => ActivitySamplingResult.AllData,
177
Sample = (ref ActivityCreationOptions<
ActivityContext
> _) => ActivitySamplingResult.AllData,
Microsoft.AspNetCore.SignalR.Core (2)
src\Shared\Diagnostics\ActivityCreator.cs (2)
36
if (
ActivityContext
.TryParse(requestId, traceState, isRemote: true, out
ActivityContext
context))
Microsoft.AspNetCore.SignalR.Tests (8)
HubConnectionHandlerTests.Activity.cs (8)
39
Sample = (ref ActivityCreationOptions<
ActivityContext
> _) => ActivitySamplingResult.AllData,
114
Sample = (ref ActivityCreationOptions<
ActivityContext
> _) => ActivitySamplingResult.AllData,
183
Sample = (ref ActivityCreationOptions<
ActivityContext
> _) => ActivitySamplingResult.AllData,
242
Sample = (ref ActivityCreationOptions<
ActivityContext
> _) => ActivitySamplingResult.AllData,
315
Sample = (ref ActivityCreationOptions<
ActivityContext
> _) => ActivitySamplingResult.AllData,
362
Sample = (ref ActivityCreationOptions<
ActivityContext
> _) => ActivitySamplingResult.AllData,
414
Sample = (ref ActivityCreationOptions<
ActivityContext
> _) => ActivitySamplingResult.AllData,
465
Sample = (ref ActivityCreationOptions<
ActivityContext
> _) => ActivitySamplingResult.AllData,
Stress.ApiService (1)
TraceCreator.cs (1)
125
ActivityContext
activityContext;
System.Diagnostics.DiagnosticSource (61)
System\Diagnostics\Activity.cs (3)
778
public
ActivityContext
Context => new ActivityContext(TraceId, SpanId, ActivityTraceFlags, TraceStateString);
1083
internal static bool TryConvertIdToContext(string traceParent, string? traceState, bool isRemote, out
ActivityContext
context)
1178
internal static Activity Create(ActivitySource source, string name, ActivityKind kind, string? parentId,
ActivityContext
parentContext,
System\Diagnostics\ActivityContext.cs (11)
13
public readonly partial struct ActivityContext : IEquatable<
ActivityContext
>
70
public static bool TryParse(string? traceParent, string? traceState, bool isRemote, out
ActivityContext
context)
87
public static bool TryParse(string? traceParent, string? traceState, out
ActivityContext
context) => TryParse(traceParent, traceState, isRemote: false, out context);
97
public static
ActivityContext
Parse(string traceParent, string? traceState)
104
if (!Activity.TryConvertIdToContext(traceParent, traceState, isRemote: false, out
ActivityContext
context))
112
public bool Equals(
ActivityContext
value) => SpanId.Equals(value.SpanId) && TraceId.Equals(value.TraceId) && TraceFlags == value.TraceFlags && TraceState == value.TraceState && IsRemote == value.IsRemote;
114
public override bool Equals([NotNullWhen(true)] object? obj) => (obj is
ActivityContext
context) ? Equals(context) : false;
115
public static bool operator ==(
ActivityContext
left,
ActivityContext
right) => left.Equals(right);
116
public static bool operator !=(
ActivityContext
left,
ActivityContext
right) => !(left == right);
System\Diagnostics\ActivityContext.netcoreapp.cs (1)
10
public readonly partial struct ActivityContext : IEquatable<
ActivityContext
>
System\Diagnostics\ActivityCreationOptions.cs (9)
10
/// The possible generic type parameters is <see cref="
ActivityContext
"/> or <see cref="string"/>
15
private readonly
ActivityContext
_context;
23
/// <param name="parent">The requested parent to create the Activity object with. The parent either be a parent Id represented as string or it can be a parent context <see cref="
ActivityContext
"/>.</param>
25
/// <param name="tags">Key-value pairs list for the tags to create the Activity object with.<see cref="
ActivityContext
"/></param>
46
if (parent is
ActivityContext
ac && ac != default)
60
if (
ActivityContext
.TryParse(p, null, out _context))
101
/// Retrieve the parent which requested to create the Activity object with. Parent will be either in form of string or <see cref="
ActivityContext
"/>.
133
if (Parent is
ActivityContext
&& IdFormat == ActivityIdFormat.W3C && _context == default)
169
internal
ActivityContext
GetContext() => _context;
System\Diagnostics\ActivityLink.cs (7)
10
/// Activity may be linked to zero or more other <see cref="
ActivityContext
"/> that are causally related.
22
/// <param name="context">The trace Activity context<see cref="
ActivityContext
"/></param>
23
/// <param name="tags">The key-value pair list of tags which associated to the <see cref="
ActivityContext
"/></param>
24
public ActivityLink(
ActivityContext
context, ActivityTagsCollection? tags = null)
32
/// Retrieve the <see cref="
ActivityContext
"/> object inside this <see cref="ActivityLink"/> object.
34
public
ActivityContext
Context { get; }
37
/// Retrieve the key-value pair list of tags attached with the <see cref="
ActivityContext
"/>.
System\Diagnostics\ActivityLink.netcoreapp.cs (1)
9
/// Activity may be linked to zero or more other <see cref="
ActivityContext
"/> that are causally related.
System\Diagnostics\ActivityListener.cs (1)
58
public SampleActivity<
ActivityContext
>? Sample { get; set; }
System\Diagnostics\ActivitySource.cs (17)
117
/// <param name="parentContext">The parent <see cref="
ActivityContext
"/> object to initialize the created Activity object with.</param>
125
public Activity? CreateActivity(string name, ActivityKind kind,
ActivityContext
parentContext, IEnumerable<KeyValuePair<string, object?>>? tags = null, IEnumerable<ActivityLink>? links = null, ActivityIdFormat idFormat = ActivityIdFormat.Unknown)
158
/// <param name="parentContext">The parent <see cref="
ActivityContext
"/> object to initialize the created Activity object with.</param>
163
public Activity? StartActivity(string name, ActivityKind kind,
ActivityContext
parentContext, IEnumerable<KeyValuePair<string, object?>>? tags = null, IEnumerable<ActivityLink>? links = null, DateTimeOffset startTime = default)
183
/// <param name="parentContext">The parent <see cref="
ActivityContext
"/> object to initialize the created Activity object with.</param>
189
public Activity? StartActivity(ActivityKind kind,
ActivityContext
parentContext = default, IEnumerable<KeyValuePair<string, object?>>? tags = null, IEnumerable<ActivityLink>? links = null, DateTimeOffset startTime = default, [CallerMemberName] string name = "")
192
private Activity? CreateActivity(string name, ActivityKind kind,
ActivityContext
context, string? parentId, IEnumerable<KeyValuePair<string, object?>>? tags,
211
ActivityCreationOptions<
ActivityContext
> acoContext = default;
217
acoContext = new ActivityCreationOptions<
ActivityContext
>(this, name, aco.GetContext(), kind, tags, links, ActivityIdFormat.W3C);
220
listeners.EnumWithFunc((ActivityListener listener, ref ActivityCreationOptions<string> data, ref ActivitySamplingResult result, ref ActivityCreationOptions<
ActivityContext
> dataWithContext) => {
238
SampleActivity<
ActivityContext
>? sample = listener.Sample;
289
var aco = new ActivityCreationOptions<
ActivityContext
>(this, name, useCurrentActivityContext ? Activity.Current!.Context : context, kind, tags, links, idFormat);
290
listeners.EnumWithFunc((ActivityListener listener, ref ActivityCreationOptions<
ActivityContext
> data, ref ActivitySamplingResult result, ref ActivityCreationOptions<
ActivityContext
> unused) => {
291
SampleActivity<
ActivityContext
>? sample = listener.Sample;
355
internal delegate void Function<T, TParent>(T item, ref ActivityCreationOptions<TParent> data, ref ActivitySamplingResult samplingResult, ref ActivityCreationOptions<
ActivityContext
> dataWithContext);
486
public void EnumWithFunc<TParent>(ActivitySource.Function<T, TParent> func, ref ActivityCreationOptions<TParent> data, ref ActivitySamplingResult samplingResult, ref ActivityCreationOptions<
ActivityContext
> dataWithContext)
System\Diagnostics\DsesActivitySourceListener.cs (4)
165
[DynamicDependency(DynamicallyAccessedMemberTypes.PublicProperties, typeof(
ActivityContext
))]
194
ActivityCreationOptions<
ActivityContext
> activityContextOptions = default;
199
private ActivitySamplingResult OnSample(ref ActivityCreationOptions<
ActivityContext
> options)
208
ref ActivityCreationOptions<
ActivityContext
> options)
System\Diagnostics\DsesFilterAndTransform.cs (3)
215
DsesSampleActivityFunc sampleFunc = static (bool hasActivityContext, ref ActivityCreationOptions<
ActivityContext
> options)
242
sampleFunc = static (bool hasActivityContext, ref ActivityCreationOptions<
ActivityContext
> options) => ActivitySamplingResult.PropagationData;
246
sampleFunc = static (bool hasActivityContext, ref ActivityCreationOptions<
ActivityContext
> options) => ActivitySamplingResult.AllData;
System\Diagnostics\DsesSamplerBuilder.cs (4)
8
ref ActivityCreationOptions<
ActivityContext
> options);
20
return (bool hasActivityContext, ref ActivityCreationOptions<
ActivityContext
> options) =>
24
ActivityContext
parentContext = options.Parent;
39
public static ActivitySamplingResult ParentRatioSampler(long idUpperBound, in
ActivityContext
parentContext, ActivityTraceId traceId)