System.Diagnostics.DiagnosticSource Represents an operation with context to be used for logging. Initializes a new instance of the class. The name of the operation. Updates the to have a new baggage item with the specified key and value. The baggage key. The baggage value. for convenient chaining. Adds the specified activity event to the events list. The activity event to add. for convenient chaining. Updates the activity to have a tag with an additional and . The tag key name. The tag value mapped to the input key. for convenient chaining. Updates the to have a new tag with the provided and . The tag key. The tag value. for convenient chaining. Stops the activity if it is already started and notifies any event listeners. Nothing will happen otherwise. When overriden by a derived type, this method releases any allocated resources. if the method is being called from the finalizer; if calling from user code. Returns the value of a key-value pair added to the activity with . The baggage key. The value of the key-value-pair item if it exists, or if it does not exist. Returns the object mapped to the specified property name. The name associated to the object. The object mapped to the property name, if one is found; otherwise, . Attaches any custom object to this activity. If the specified was previously associated with another object, the property will be updated to be associated with the new instead. It is recommended to use a unique property name to avoid conflicts with anyone using the same value. The name to associate the value with. The object to attach and map to the property name. Updates the to set its as the difference between and the specified stop time. The UTC stop time. for convenient chaining. Sets the ID format on this before it is started. One of the enumeration values that specifies the format of the property. for convenient chaining. Sets the parent ID using the W3C convention of a TraceId and a SpanId. The parent activity's TraceId. The parent activity's SpanId. One of the enumeration values that specifies flags defined by the W3C standard that are associated with an activity. for convenient chaining. Updates this to indicate that the with an ID of caused this . The ID of the parent operation. for convenient chaining. Sets the start time of this . The start time in UTC. for convenient chaining. Adds or update the activity tag with the input key and value. The tag key name. The tag value mapped to the input key. for convenient chaining. Starts the activity. for convenient chaining. Stops the activity. Gets the flags (defined by the W3C ID specification) associated with the activity. the flags associated with the activity. Gets a collection of key/value pairs that represents information that is passed to children of this . An enumeration of string-string key-value pairs. Gets the context of the activity. Context becomes valid only if the activity has been started. The context of the activity, if the activity has been started; otherwise, returns the default context. Gets or sets the current operation () for the current thread. This flows across async calls. The current operation for the current thread. Gets or sets the default ID format for the . Gets or sets the display name of the activity. A string that represents the activity display name. Gets the duration of the operation. The delta between and the end time if the has ended ( or was called), or if the has not ended and was not called. Gets the list of all the activity events attached to this activity. An enumeration of activity events attached to this activity. If the activity has no events, returns an empty enumeration. Gets or sets a valud that detrmines if the is always used to define the default ID format. to always use the ; otherwise, . Gets an identifier that is specific to a particular request. The activity ID. Gets the format for the . The format for the . Indicates if the this activity should be populated with all the propagation information, as well as all the other properties such as links, tags and events. if the activity should be populated; otherwise. Gets the relationship between the activity, its parents, and its children in a trace. One of the enumeration values that indicate relationship between the activity, its parents, and its children in a trace. Gets the list of all the activity links attached to this activity. An enumeration of activity links attached to this activity. If the activity has no links, returns an empty enumeration. Gets the operation name. The name of the operation. Gets the parent that created this activity. The parent of this , if it is from the same process, or if this instance has no parent (it is a root activity) or if the parent is from outside the process. Gets the ID of this activity's parent. The parent ID, if one exists, or if it does not. Gets the parent's . The parent's . Gets a value that indicates whether the W3CIdFlags.Recorded flag is set. if the W3CIdFlags.Recorded flag is set; otherwise, . Gets the root ID of this . The root ID, or if the current instance has either a or an . Get the activity source associated with this activity. Gets the SPAN part of the . The ID for the SPAN part of , if the has the W3C format; otherwise, a zero . Gets the time when the operation started. The UTC time that the operation started. Returns the list of tags representing information to log along with the activity. This information is not passed on to the children of this activity. A key-value pair enumeration of tags and objects. Gets a collection of key/value pairs that represent information that will be logged along with the to the logging system. An enumeration of string-string key-value-pairs. Gets the TraceId part of the . The ID for the TraceId part of the , if the ID has the W3C format; otherwise, a zero TraceId. Gets the W3C header. The W3C header. A representation that conforms to the W3C TraceContext specification. It contains two identifiers: a TraceId and a SpanId, along with a set of common TraceFlags and system-specific TraceState values. Construct a new activity context instance using the specified arguments. A trace identifier. A span identifier. Contain details about the trace. Carries system-specific configuration data. Indicates if the context is propagated from a remote parent. Indicates whether the current object is equal to another object of the same type. The object to compare to this instance. if the current object is equal to the parameter; otherwise, . Determines whether this instance and a specified object have the same value. The object to compare to this instance. if the current object is equal to the parameter; otherwise, . Provides a hash function for the current that's suitable for hashing algorithms and data structures, such as hash tables. A hash code for the current . Determines whether two specified values are equal. The first value to compare. The second value to compare. if and are equal; otherwise, . Determines whether two specified values are not equal. The first value to compare. The second value to compare. if and are not equal; otherwise, . Parses a W3C trace context headers to an object. The W3C trace parent header. The trace state. The trace parent is invalid. The object created from the parsing operation. Tries to parse the W3C trace context headers to an object. The W3C trace parent header. The W3C trace state. When this method returns , the object created from the parsing operation. if the parsing was successful; otherwise. Indicates if the activity context was propagated from a remote parent. if it was propagated from a remote parent; otherwise. The Id of the request as known by the caller. The Span Id in the context. The flags defined by the W3C standard along with the ID for the activity. The context tracing flags. The trace identifier. The tracing identifier in the context. Holds the W3C 'tracestate' header. A string representing the W3C 'tracestate' header. Encapsulates all the information that is sent to the activity listener, to make decisions about the creation of the activity instance, as well as its state. The possible generic type parameters are or . The type of the property. Should be either or . Gets the activity kind which the activity will be created with. One of the enumeration values that represent an activity kind. Gets the enumeration of activity links that the activity will be created with. An enumeration of activity links. Gets the name to use as OperationName of the activity that will get created. A string representing the activity name. Gets the parent context or parent Id that the activity will get created with. The parent of the activity, represented either as a or as an . Gets the collection that is used to add more tags during the sampling process. The added tags are also added to the created Activity if it is decided that it should be created by the callbacks. The Activity tags collection. Gets the activity source that creates the activity. An activity source object. Gets the tags that the activity will be created with. A key-value pair enumeration of tags associated with the activity. Gets the trace Id to use in the Activity object if it is decided that it should be created by callbacks. The trace Id. Represents an event containing a name and a timestamp, as well as an optional list of tags. Initializes a new activity event instance using the specified name and the current time as the event timestamp. The event name. Initializes a new activity event instance using the specified name, timestamp and tags. The event name. The event timestamp. Timestamp must only be used for the events that happened in the past, not at the moment of this call. The event tags. Gets the activity event name. A string representing the activity event name. Gets the collection of tags associated with the event. A key-value pair enumeration containing the tags associated with the event. Gets the activity event timestamp. A datetime offset representing the activity event timestamp. Specifies the format of the property. The hierarchical format. An unknown format. The W3C format. Describes the relationship between the activity, its parents and its children in a trace. Outgoing request to the external component. Output received from an external component. Internal operation within an application, as opposed to operations with remote parents or children. This is the default value. Output provided to external components. Requests incoming from external component. Activities may be linked to zero or more activity context instances that are causally related. Activity links can point to activity contexts inside a single trace or across different traces. Activity links can be used to represent batched operations where an activity was initiated by multiple initiating activities, each representing a single incoming item being processed in the batch. Constructs a new activity link, which can be linked to an activity. The trace activity context. The key-value pair list of tags associated to the activity context. Indicates whether the current activity link is equal to another activity link. The activity link to compare. if the current activity link is equal to ; otherwise, . Indicates whether the current activity link is equal to another object. The object to compare. if the current activity link is equal to ; otherwise, . Provides a hash function for the current that's suitable for hashing algorithms and data structures, such as hash tables. A hash code for the current . Determines whether two specified values are equal. The first value to compare. The second value to compare. if and are equal; otherwise, . Determines whether two specified values are not equal. The first value to compare. The second value to compare. if and are not equal; otherwise, . Retrieves the activity context inside this activity link. Retrieves the key-value pair enumeration of tags attached to the activity context. An enumeration of tags attached to the activity context. Allows listening to the start and stop activity events and gives the opportunity to decide creating an activity for sampling scenarios. Construct a new activity listener object to start listeneing to the activity events. Unregisters this activity listener object from listening to activity events. Gets or sets the callback used to listen to the activity start event. An activity callback instance used to listen to the activity start event. Gets or sets the callback used to listen to the activity stop event. An activity callback instance used to listen to the activity stop event. Gets or sets the callback that is used to decide if creating objects with a specific data state is allowed. A sample activity instance. Gets or sets the callback that is used to decide if creating objects with a specific data state is allowed. A sample activity instance. Gets or sets the callback that allows deciding if activity object events that were created using the activity source object should be listened or not. to listen events; otherwise. Enumeration values used by to indicate the amount of data to collect for the related . Requesting more data causes a greater performance overhead. The activity object should be populated with all the propagation information and also all other properties such as Links, Tags, and Events. Using this value causes to return . The activity object should be populated the same as the case. Additionally, Activity.Recorded is set to . For activities using the W3C trace ids, this sets a flag bit in the ID that will be propagated downstream requesting that the trace is recorded everywhere. The activity object does not need to be created. The activity object needs to be created. It will have a Name, a Source, an Id and Baggage. Other properties are unnecessary and will be ignored by this listener. Provides APIs to create and start objects and to register objects to listen to the events. Constructs an activity source object with the specified . The name of the activity source object. The version of the component publishing the tracing info. Adds a listener to the activity starting and stopping events. The activity listener object to use for listening to the activity events. Disposes the activity source object, removes the current instance from the global list, and empties the listeners list. Checks if there are any listeners for this activity source. if there is a listener registered for this activity source; otherwise, . Creates a new activity if there are active listeners for it, using the specified name and activity kind. The operation name of the activity. The activity kind. The created activity object, if it had active listeners, or if it has no event listeners. Creates a new activity if there are active listeners for it, using the specified name, activity kind, parent activity context, tags, optional activity link and optional start time. The operation name of the activity. The activity kind. The parent object to initialize the created activity object with. The optional tags list to initialize the created activity object with. The optional list to initialize the created activity object with. The optional start timestamp to set on the created activity object. The created activity object, if it had active listeners, or if it has no event listeners. Creates a new activity if there are active listeners for it, using the specified name, activity kind, parent Id, tags, optional activity links and optional start time. The operation name of the activity. The activity kind. The parent Id to initialize the created activity object with. The optional tags list to initialize the created activity object with. The optional list to initialize the created activity object with. The optional start timestamp to set on the created activity object. The created activity object, if it had active listeners, or if it has no event listeners. Returns the activity source name. A string that represents the activity source name. Returns the activity source version. A string that represents the activity source version. Represents a formatted based on a W3C standard. Copies the 8 bytes of the current to a specified span. The span to which the 8 bytes of the SpanID are to be copied. Creates a new value from a read-only span of eight bytes. A read-only span of eight bytes. does not contain eight bytes. The new span ID. Creates a new value from a read-only span of 16 hexadecimal characters. A span that contains 16 hexadecimal characters. does not contain 16 hexadecimal characters. -or- The characters in are not all lower-case hexadecimal characters or all zeros. The new span ID. Creates a new value from a read-only span of UTF8-encoded bytes. A read-only span of UTF8-encoded bytes. The new span ID. Creates a new based on a random number (that is very likely to be unique). The new span ID. Determines whether this instance and the specified instance have the same value. The instance to compare. if has the same hex value as the current instance; otherwise, . the current instance and a specified object, which also must be an instance, have the same value. The object to compare. if is an instance of and has the same hex value as the current instance; otherwise, . Returns the hash code of the SpanId. The hash code of the SpanId. Determines whether two specified instances have the same value. The first instance to compare. The second instance to compare. if the SpanId of is the same as the SpanId of ; otherwise, . Determine whether two specified instances have unequal values. The first instance to compare. The second instance to compare. if the SpanId of is different from the SpanId of ; otherwise, . Returns a 16-character hexadecimal string that represents this span ID. The 16-character hexadecimal string representation of this span ID. Returns a 16-character hexadecimal string that represents this span ID. The 16-character hexadecimal string representation of this span ID. ActivityTagsCollection is a collection class used to store tracing tags. This collection will be used with classes like and . This collection behaves as follows: - The collection items will be ordered according to how they are added. - Don't allow duplication of items with the same key. - When using the indexer to store an item in the collection: - If the item has a key that previously existed in the collection and the value is , the collection item matching the key will be removed from the collection. - If the item has a key that previously existed in the collection and the value is not , the new item value will replace the old value stored in the collection. - Otherwise, the item will be added to the collection. - Add method will add a new item to the collection if an item doesn't already exist with the same key. Otherwise, it will throw an exception. Create a new instance of the collection. Create a new instance of the collection and store the input list items in the collection. Initial list to store in the collection. Adds an item to the collection Key and value pair of the tag to add to the collection. already exists in the list. is . Adds a tag with the provided key and value to the collection. This collection doesn't allow adding two tags with the same key. The tag key. The tag value. Removes all items from the collection. Determines whether the contains a specific value. The object to locate in the . if is found in the ; otherwise, . Determines whether the collection contains an element with the specified key. The key to locate in the . if the collection contains tag with that key. otherwise. Copies the elements of the collection to an array, starting at a particular array index. The array that is the destination of the elements copied from collection. The zero-based index in array at which copying begins. Returns an enumerator that iterates through the collection. An enumerator for the . Removes the first occurrence of a specific item from the collection. The tag key value pair to remove. if item was successfully removed from the collection; otherwise, . This method also returns if item is not found in the original collection. Removes the tag with the specified key from the collection. The tag key. if the item existed and removed. otherwise. Returns an enumerator that iterates through the collection. An enumerator that can be used to iterate through the collection. Returns an enumerator that iterates through the collection. An object that can be used to iterate through the collection. Gets the value associated with the specified key. The tag key. The tag value. When this method returns, the value associated with the specified key, if the key is found; otherwise, the default value for the type of the value parameter. This parameter is passed uninitialized. Gets the number of elements contained in the collection. Gets a value indicating whether the collection is read-only. This always returns . Always returns . Gets or sets a specified collection item. When setting a value to this indexer property, the following behavior is observed: - If the key previously existed in the collection and the value is , the collection item matching the key will get removed from the collection. - If the key previously existed in the collection and the value is not , the value will replace the old value stored in the collection. - Otherwise, a new item will get added to the collection. The key of the value to get or set. The object mapped to the key. Get the list of the keys of all stored tags. Get the list of the values of all stored tags. Enumerates the elements of an . Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. Advances the enumerator to the next element of the collection. if the enumerator was successfully advanced to the next element; if the enumerator has passed the end of the collection. Sets the enumerator to its initial position, which is before the first element in the collection. Gets the element in the collection at the current position of the enumerator. The element in the collection at the current position of the enumerator. Gets the element in the collection at the current position of the enumerator. The element in the collection at the current position of the enumerator. Specifies flags defined by the W3C standard that are associated with an activity. The activity has not been marked. The activity (or more likely its parents) has been marked as useful to record. Represents a whose format is based on a W3C standard. Copies the 16 bytes of the current to a specified span. The span to which the 16 bytes of the trace ID are to be copied. Creates a new value from a read-only span of 16 bytes. A read-only span of 16 bytes. does not contain eight bytes. The new trace ID. Creates a new value from a read-only span of 32 hexadecimal characters. A span that contains 32 hexadecimal characters. does not contain 16 hexadecimal characters. -or- The characters in are not all lower-case hexadecimal characters or all zeros. The new trace ID. Creates a new value from a read-only span of UTF8-encoded bytes. A read-only span of UTF8-encoded bytes. The new trace ID. Creates a new based on a random number (that is very likely to be unique). The new span ID. Determines whether the current instance and a specified are equal. The instance to compare. if has the same hex value as the current instance; otherwise, . Determines whether this instance and a specified object, which must also be an instance, have the same value. The object to compare. if is an instance of and has the same hex value as the current instance; otherwise, . Returns the hash code of the TraceId. The hash code of the TraceId. Determines whether two specified instances have the same value. The first instance to compare. The second instance to compare. if the TraceId of is the same as the TraceId of ; otherwise, . Determines whether two specified instances have the same value. The first instance to compare. The second instance to compare. if the TraceId of is different from the TraceId of ; otherwise, . Returns a 16-character hexadecimal string that represents this span ID. The 32-character hexadecimal string representation of this trace ID. Returns a 32-character hexadecimal string that represents this trace ID. The 32-character hexadecimal string representation of this trace ID. Provides an implementation of the abstract class that represents a named place to which a source sends its information (events). Creates a new . The name of this . Disposes the NotificationListeners. Determines whether there are any registered subscribers. if there are any registered subscribers, otherwise. Checks whether the is enabled. The name of the event to check. if notifications are enabled; otherwise, . Checks if any subscriber to the diagnostic events is interested in receiving events with this name. Subscribers indicate their interest using a delegate provided in . The name of the event to check. The object that represents a context. The object that represents a context. if it is enabled, otherwise. Invokes the OnActivityExport method of all the subscribers. The activity affected by an external event. An object that represents the outgoing request. Invokes the OnActivityImport method of all the subscribers. The activity affected by an external event. An object that represents the incoming request. Adds a subscriber. A subscriber. A reference to an interface that allows the listener to stop receiving notifications before the has finished sending them. Adds a subscriber, and optionally filters events based on their name and up to two context objects. A subscriber. A delegate that filters events based on their name and up to two context objects (which can be ), or to if an event filter is not desirable. A reference to an interface that allows the listener to stop receiving notifications before the has finished sending them. Adds a subscriber, optionally filters events based on their name and up to two context objects, and specifies methods to call when providers import or export activites from outside the process. A subscriber. A delegate that filters events based on their name and up to two context objects (which can be ), or if an event filter is not desirable. An action delegate that receives the activity affected by an external event and an object that represents the incoming request. An action delegate that receives the activity affected by an external event and an object that represents the outgoing request. A reference to an interface that allows the listener to stop receiving notifications before the has finished sending them. Adds a subscriber, and optionally filters events based on their name. A subscriber. A delegate that filters events based on their name (). The delegate should return if the event is enabled. A reference to an interface that allows the listener to stop receiving notifications before the has finished sending them. Returns a string with the name of this DiagnosticListener. The name of this DiagnosticListener. Logs a notification. The name of the event to log. An object that represents the payload for the event. Gets the collection of listeners for this . Gets the name of this . The name of the . An abstract class that allows code to be instrumented for production-time logging of rich data payloads for consumption within the process that was instrumented. Initializes an instance of the class. Verifies if the notification event is enabled. The name of the event being written. if the notification event is enabled, otherwise. Verifies it the notification event is enabled. The name of the event being written. An object that represents the additional context for IsEnabled. Consumers should expect to receive which may indicate that producer called pure IsEnabled(string) to check if consumer wants to get notifications for such events at all. Based on that, producer may call IsEnabled(string, object, object) again with non- context. Optional. An object that represents the additional context for IsEnabled. by default. Consumers should expect to receive which may indicate that producer called pure IsEnabled(string) or producer passed all necessary context in . if the notification event is enabled, otherwise. Transfers state from an activity to some event or operation, such as an outgoing HTTP request, that will occur outside the process. The activity affected by an external event. An object that represents the outgoing request. Transfers state to an activity from some event or operation, such as an incoming request, that occurred outside the process. The activity affected by an external event. A payload that represents the incoming request. Starts an and writes a start event. The to be started. An object that represent the value being passed as a payload for the event. The started activity for convenient chaining. Stops the given , maintains the global activity, and notifies consumers that the was stopped. The activity to be stopped. An object that represents the value passed as a payload for the event. Provides a generic way of logging complex payloads. The name of the event being written. An object that represents the value being passed as a payload for the event. This is often an anonymous type which contains several sub-values. A delegate that defines the signature of the callbacks used in the sampling process. The Activity creation options used by callbacks to decide creating the Activity object or not. The type of the requested parent to create the Activity object with. Should be either a string or an instance. An object containing the sampling results, which indicate the amount of data to collect for the related .