33 if (
value.Value ==
null)
44 diagNode.Value =
value;
209 if (
value.Value ==
null)
220 diagNode.Value =
value;
254 if (current.Value.Value
is string || current.Value.Value ==
null)
499 yield return current.Value;
775 else if (
string.IsNullOrEmpty(
parentId))
904 if (
id.Length == 55 && ((
'0' <=
id[0] &&
id[0] <=
'9') || (
'a' <=
id[0] &&
id[0] <=
'f')) && ((
'0' <=
id[1] &&
id[1] <=
'9') || (
'a' <=
id[1] &&
id[1] <=
'f')))
978 internal static Activity Create(
ActivitySource source,
string name,
ActivityKind kind,
string parentId,
ActivityContext parentContext,
IEnumerable<
KeyValuePair<string, object>> tags,
IEnumerable<ActivityLink> links,
DateTimeOffset startTime,
ActivityTagsCollection samplerTags,
ActivitySamplingResult request,
bool startIt,
ActivityIdFormat idFormat)
982 activity.Kind = kind;
1023 activity._parentTraceFlags = (byte)
parentContext.TraceFlags;
1033 activity.StartTimeUtc =
startTime.UtcDateTime;
1075 char c =
text[text.Length - 1];
1076 if (c !=
'.' && c !=
'_')
1089 return id.Substring(3, 32);
1091 int num =
id.IndexOf(
'.');
1096 int num2 = ((
id[0] ==
'|') ? 1 : 0);
1097 return id.Substring(
num2, num -
num2);
1122 return *(
long*)(&guid);
1127 bool flag =
activity ==
null || (activity.Id !=
null && !
activity.IsFinished);
bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value)
bool ICollection< KeyValuePair< TKey, TValue > >. Remove(KeyValuePair< TKey, TValue > keyValuePair)
Enumerator GetEnumerator()
void Add(TKey key, TValue value)
void NotifyActivityStart(Activity activity)
void NotifyActivityStop(Activity activity)
BaggageLinkedList(KeyValuePair< string, string > firstValue, bool set=false)
DiagNode< KeyValuePair< string, string > > First
Enumerator< KeyValuePair< string, string > > GetEnumerator()
DiagNode< KeyValuePair< string, string > > _first
void Set(KeyValuePair< string, string > value)
void Add(KeyValuePair< string, string > value)
IEnumerable< KeyValuePair< string, string?> > Baggage
Activity AddTag(string key, string? value)
Activity AddTag(string key, object? value)
static bool TryConvertIdToContext(string traceParent, string traceState, out ActivityContext context)
IEnumerable< ActivityLink > Links
static readonly AsyncLocal< Activity > s_current
Activity(string operationName)
Activity SetStartTime(DateTime startTimeUtc)
Activity SetParentId(string parentId)
IEnumerable< KeyValuePair< string, object?> > TagObjects
static long s_currentRootId
string GetRootId(string id)
static readonly ActivitySource s_defaultSource
ActivityStatusCode _statusCode
DiagLinkedList< ActivityLink > _links
static readonly IEnumerable< KeyValuePair< string, object > > s_emptyTagObjects
Activity AddBaggage(string key, string? value)
ActivityIdFormat IdFormat
static void SetCurrent(Activity activity)
bool TrySetTraceIdFromParent()
Activity SetBaggage(string key, string? value)
static unsafe long GetRandomNumber()
virtual void Dispose(bool disposing)
Dictionary< string, object > _customProperties
string GenerateHierarchicalId()
static readonly IEnumerable< KeyValuePair< string, string > > s_emptyBaggageTags
Activity SetStatus(ActivityStatusCode code, string? description=null)
object? GetCustomProperty(string propertyName)
static string GenerateRootId()
Activity SetEndTime(DateTime endTimeUtc)
Activity SetIdFormat(ActivityIdFormat format)
static bool ForceDefaultIdFormat
static readonly IEnumerable< ActivityLink > s_emptyLinks
void SetCustomProperty(string propertyName, object? propertyValue)
static Activity Create(ActivitySource source, string name, ActivityKind kind, string parentId, ActivityContext parentContext, IEnumerable< KeyValuePair< string, object > > tags, IEnumerable< ActivityLink > links, DateTimeOffset startTime, ActivityTagsCollection samplerTags, ActivitySamplingResult request, bool startIt, ActivityIdFormat idFormat)
ActivityStatusCode Status
void TrySetTraceFlagsFromParent()
string _statusDescription
static void NotifyError(Exception exception)
Activity SetTag(string key, object? value)
static bool ValidateSetCurrent(Activity activity)
string AppendSuffix(string parentId, string suffix, char delimiter)
static bool IsW3CId(string id)
Activity _previousActiveActivity
static readonly string s_uniqSuffix
object? GetTagItem(string key)
DiagLinkedList< ActivityEvent > _events
string? StatusDescription
static readonly IEnumerable< ActivityEvent > s_emptyEvents
Activity SetParentId(ActivityTraceId traceId, ActivitySpanId spanId, ActivityTraceFlags activityTraceFlags=ActivityTraceFlags.None)
static ActivityIdFormat s_defaultIdFormat
string? GetBaggageItem(string key)
static ? Activity Current
IEnumerable< KeyValuePair< string, string?> > Tags
Activity AddEvent(ActivityEvent e)
ActivitySpanId ParentSpanId
ActivityTraceFlags ActivityTraceFlags
static DateTime GetUtcNow()
static ActivityIdFormat DefaultIdFormat
static ? Func< ActivityTraceId > TraceIdGenerator
BaggageLinkedList _baggage
static void SuppressFinalize(object obj)
static bool IsHexLowerChar(int c)
static void ToCharsBuffer(byte value, Span< char > buffer, int startingIndex=0, Casing casing=Casing.Upper)
static string ActivityNotStarted
static string SetFormatOnStartedActivity
static string ActivityStartAlreadyStarted
static string ActivityIdFormatInvalid
static string ParentIdInvalid
static string EndTimeNotUtc
static string ActivityNotRunning
static string SetParentIdOnActivityWithParent
static string ParentIdAlreadySet
static string StartTimeNotUtc
static string OperationNameInvalid
override string ToString()
StringBuilder Append(char value, int repeatCount)
static int CompareExchange(ref int location1, int value, int comparand)
static int Increment(ref int location)
new IEnumerator< T > GetEnumerator()
static unsafe DateTime UtcNow
static unsafe ActivitySpanId CreateRandom()
static ActivitySpanId CreateFromString(ReadOnlySpan< char > idData)
static ActivityTraceId CreateFromString(ReadOnlySpan< char > idData)
static ActivityTraceId CreateRandom()
static bool IsLowerCaseHexAndNotAllZeros(ReadOnlySpan< char > idData)
static byte HexByteFromChars(char char1, char char2)
static readonly TimeSpan Zero