Microsoft.AI.DependencyCollector ETW EventSource tracing class. ETW EventSource tracing class. Keywords for the . Key word for user actionable events. Key word for diagnostics events. Extension methods for the ConditionalWeakTable class. Check if a key exists before adding the key/value pair. A store for instrumentation App Ids. This makes sure we don't query the public endpoint to find an app Id for the same instrumentation key more than once. Max number of app ids to cache. Initializes a new instance of the class mostly to be used by the test classes to provide an override for fetching appId logic. The delegate to be called to fetch the appId. Initializes a new instance of the class mostly to be used by the test classes to seed the instrumentation key -> app Id relationship. A dictionary that contains known instrumentation key - app id relationship. Initializes a new instance of the class. Endpoint that is to be used to fetch appId. Retrieves the correlation id corresponding to a given instrumentation key. Instrumentation key string. AppId corresponding to the provided instrumentation key. true if correlationId was successfully retrieved; false otherwise. This method is purely a test helper at this point. It checks whether the task to get app ID is still running. True if fetch task is still in progress, false otherwise. Format and store an iKey and appId pair into the dictionary of known correlation ids. Instrumentation Key is expected to be a Guid string. Application Id is expected to be a Guid string. App Id needs to be Http Header safe, and all non-ASCII characters will be removed. Retrieves the app id given the instrumentation key. Instrumentation key for which app id is to be retrieved. App id. Strips off any relative path at the end of the base URI and then appends the known relative path to get the app id uri. AI resource's instrumentation key. Computed Uri. Registers failure for further action in future. Instrumentation key for which the failure occurred. Exception indicating failure. FetchAppIdFromService failed. Registers failure for further action in future. Instrumentation key for which the failure occurred. Response code from AppId Endpoint. Structure that represents a failed fetch app Id call. Initializes a new instance of the class. Time when the failure occurred. Failure response code. Initializes a new instance of the class. Time when the failure occurred. Gets the time of failure. Gets the integer value for response code representing the type of failure. Gets a value indicating whether the failure is likely to go away when a retry happens. Utility functions for dealing with exceptions. Get the string representation of this Exception with special handling for AggregateExceptions. The exception to convert to a string. The detailed string version of the provided exception. Generic functions that can be used to get and set Http headers. Get the key value from the provided HttpHeader value that is set up as a comma-separated list of key value pairs. Each key value pair is formatted like (key)=(value). The header values that may contain key name/value pairs. The name of the key value to find in the provided header values. The first key value, if it is found. If it is not found, then null. Given the provided list of header value strings, return a list of key name/value pairs with the provided keyName and keyValue. If the initial header value strings contains the key name, then the original key value should be replaced with the provided key value. If the initial header value strings don't contain the key name, then the key name/value pair should be added to the list and returned. The existing header values that the key/value pair should be added to. The name of the key to add. The value of the key to add. The result of setting the provided key name/value pair into the provided headerValues. Http Headers only allow Printable US-ASCII characters. Remove all other characters. An interface for getting a correlation id from a provided instrumentation key. Retrieves the correlation id corresponding to a given instrumentation key. Instrumentation key string. AppId corresponding to the provided instrumentation key. true if correlationId was successfully retrieved; false otherwise. Header names for requests / responses. Request-Context header. Source key in the request context header that is added by an application while making http requests and retrieved by the other application when processing incoming requests. Target key in the request context header that is added to the response and retrieved by the calling application when processing incoming responses. Source-RoleName key in the request context header that is added by an application while making http requests and retrieved by the other application when processing incoming requests. Target-RoleName key in the request context header that is added to the response and retrieved by the calling application when processing incoming responses. Legacy parent Id header. Legacy root id header. Standard Request-Id Id header. Standard Correlation-Context header. Remote dependency monitoring. Gets or sets a value indicating whether to disable runtime instrumentation. Gets or sets a value indicating whether to disable Http Desktop DiagnosticSource instrumentation. Gets the component correlation configuration. Gets the list of diagnostic sources and activities to exclude from collection. Gets or sets a value indicating whether the correlation headers would be set on outgoing http requests. Gets or sets the endpoint that is to be used to get the application insights resource's profile (appId etc.). IDisposable implementation. Initialize method is called after all configuration properties have been loaded from the configuration. IDisposable implementation. The method has been called directly or indirectly by a user's code. Base implementation of diagnostic event handler. Implements EventHubs DiagnosticSource events handling. Implements ServiceBus DiagnosticSource events handling. Get the DependencyTelemetry objects that are still waiting for a response from the dependency. This will most likely only be used for testing purposes. Notifies the observer that the provider has finished sending push-based notifications. Notifies the observer that the provider has experienced an error condition. An object that provides additional information about the error. Provides the observer with new data. The current notification information. Handler for Exception event, it is sent when request processing cause an exception (e.g. because of DNS or network issues) Stop event will be sent anyway with null response. Handler for Activity start event (outgoing request is about to be sent). Handler for Activity stop event (response is received for the outgoing request). Diagnostic event handler method for 'System.Net.Http.Request' event. Diagnostic event handler method for 'System.Net.Http.Response' event. This event will be fired only if response was received (and not called for faulted or canceled requests). Diagnostic listener implementation that listens for events specific to outgoing dependency requests. This method gets called once for each existing DiagnosticListener when this DiagnosticListener is added to the list of DiagnosticListeners (). This method will also be called for each subsequent DiagnosticListener that is added to the list of DiagnosticListeners. The DiagnosticListener that exists when this listener was added to the list, or a DiagnosticListener that got added after this listener was added. Notifies the observer that the provider has finished sending push-based notifications. Notifies the observer that the provider has experienced an error condition. An object that provides additional information about the error. Determines whether an URL is application insights URL. HTTP URL. True if URL is application insights url, otherwise false. Determines whether an URL is application insights URL. HTTP URL. True if URL is application insights url, otherwise false. ETW EventSource tracing class. Logs the information when the DependencyTelemetry item is null as warning. Logs the information when the HttpWebRequest is null as warning. Logs the information when a telemetry item that is already existing in the tables (that is currently being tracked) is tracked again. Logs the information when the telemetry item to track is null. Keywords for the . Key word for user actionable events. Key word for resource discovery module failures. Dependency TargetName helper. Returns dependency target name from the given Uri. Port name is included in target for non-standard ports. Dependency uri from which target is to be extracted. Dependency target name. Base implementation of DiagnosticSource listener. Takes care of managing subscriptions to multiple sources and their events. The type of processing context for given diagnostic source. This method gets called once for each existing DiagnosticListener when this DiagnosticListener is added to the list of DiagnosticListeners (). This method will also be called for each subsequent DiagnosticListener that is added to the list of DiagnosticListeners. The DiagnosticListener that exists when this listener was added to the list, or a DiagnosticListener that got added after this listener was added. Notifies the observer that the provider has finished sending push-based notifications. Notifies the observer that the provider has experienced an error condition. An object that provides additional information about the error. Checks if the diagnostic source is enabled by this listener. The diagnostic source. true if Diagnostic Source is enabled. Checks if the Activity is enabled by configuration based on the event name. The event name. The diagnostic source-specific context (). true if Diagnostic Source Activity and corresponding event are enabled. Gets diagnostic source-specific context for processing events from that source. The diagnostic source. The context. Gets event handler for specific diagnostic source. The diagnostic source name. Event handler. Event listener for a single Diagnostic Source. Notifies the observer that the provider has finished sending push-based notifications. Notifies the observer that the provider has experienced an error condition. An object that provides additional information about the error. HTTP Dependency parser that attempts to parse dependency as Azure Blob call. Tries parsing given dependency telemetry item. Dependency item to parse. It is expected to be of HTTP type. true if successfully parsed dependency. HTTP Dependency parser that attempts to parse dependency as Azure IoT Hub call. Tries parsing given dependency telemetry item. Dependency item to parse. It is expected to be of HTTP type. true if successfully parsed dependency. HTTP Dependency parser that attempts to parse dependency as Azure Queue call. Tries parsing given dependency telemetry item. Dependency item to parse. It is expected to be of HTTP type. true if successfully parsed dependency. HTTP Dependency parser that attempts to parse dependency as Azure Service Bus call. Tries parsing given dependency telemetry item. Dependency item to parse. It is expected to be of HTTP type. true if successfully parsed dependency. HTTP Dependency parser that attempts to parse dependency as Azure Table call. Tries parsing given dependency telemetry item. Dependency item to parse. It is expected to be of HTTP type. true if successfully parsed dependency. HTTP Dependency parser that attempts to parse dependency as Azure DocumentDB call. Tries parsing given dependency telemetry item. Dependency item to parse. It is expected to be of HTTP type. true if successfully parsed dependency. HTTP Dependency parser that attempts to parse dependency as generic WCF or Web Service call. Tries parsing given dependency telemetry item. Dependency item to parse. It is expected to be of HTTP type. true if successfully parsed dependency. Builds a resource operation moniker in the format of "VERB /a/*/b/*/c". The HTTP verb. The resource path represented as a list of resource type and resource ID pairs. Operation moniker string. Parses request path into REST resource path represented as a list of resource type and resource ID pairs. The request path. A list of resource type and resource ID pairs. Tokenizes request path. E.g. the string "/a/b/c/d?e=f" will be tokenized into [ "a", "b", "c", "d" ]. The request path. List of tokens. Extracts parameters from query string. The request path. Dictionary of query parameters. If parameter is specified more than once then the last value is returned. Extracts the HTTP verb from dependency name. The dependency name. The extracted verb (null if not matched). The dependency name sans the extracted verb. List of supported verbs to extract. Splits substring by given delimiters. The string to split. The delimiters. The index at which splitting will start. This is not validated and expected to be within input string range. The index at which splitting will end. If -1 then string will be split till it's end. This is not validated and expected to be less than string length. A list of substrings. Checks if a string ends with any of the specified suffixes. The string to check. The suffixes. true if string ends with any of the suffixes. DiagnosticsSource events handler. Handles event and tracks telemetry if needed. The event. DiagnosticListener that sent this event. Checks if the event is enabled by this listener. The event name. First event input object (). Second event input object (). Single high precision clock used by operations. High precision stopwatch. Number of 100 nanoseconds per high-precision clock tick. The time clock started. Gets number of ticks elapsed on the clock since the start. Calculates time between two clock readings. Start time in ticks. End time in ticks. Time between two clock readings. Converts time on the operation clock (in ticks) to date and time structure. Ticks elapsed according to operation watch. Date time structure representing the date and time that corresponds to the operation clock reading. Efficient implementation of fetching properties of anonymous types with reflection. Create a property fetcher from a .NET Reflection PropertyInfo class that represents a property of a particular type. Given an object, fetch the property that this propertyFetch represents. Telemetry Initializer that parses http dependencies into well-known types like Azure Storage. If telemetry item is http dependency - converts it to the well-known type of the dependency. Telemetry item to convert. Sanitized collection on host strings. We sanitize before adding to the list. We try our best to extract the host name from the passed in item and store that in the collection. Item to be added.