DependencyTelemetry Class

Definition

The class that represents information about the collected dependency. Learn more.

public sealed class DependencyTelemetry : Microsoft.ApplicationInsights.Extensibility.Implementation.OperationTelemetry, Microsoft.ApplicationInsights.DataContracts.ISupportAdvancedSampling
type DependencyTelemetry = class
    inherit OperationTelemetry
    interface ITelemetry
    interface ISupportProperties
    interface ISupportAdvancedSampling
    interface ISupportSampling
    interface ISupportMetrics
Public NotInheritable Class DependencyTelemetry
Inherits OperationTelemetry
Implements ISupportAdvancedSampling
Inheritance
System.Object
DependencyTelemetry
Implements

Constructors

DependencyTelemetry()

Initializes a new instance of the DependencyTelemetry class.

DependencyTelemetry(String, String, DateTimeOffset, TimeSpan, Boolean)
Obsolete.

Initializes a new instance of the DependencyTelemetry class with the given dependencyName, data, startTime, duration and success property values.

DependencyTelemetry(String, String, String, String)

Initializes a new instance of the DependencyTelemetry class with the given dependencyTypeName, target, dependencyName, data property values.

DependencyTelemetry(String, String, String, String, DateTimeOffset, TimeSpan, String, Boolean)

Initializes a new instance of the DependencyTelemetry class with the given dependencyTypeName, target, dependencyName, data, startTime, duration, resultCode and success and property values.

Properties

CommandName
Obsolete.

Gets or sets text of SQL command or empty it not applicable.

Context

Gets the context associated with the current telemetry item.

Data

Gets or sets data associated with the current dependency instance. Command name/statement for SQL dependency, URL for http dependency.

DependencyTypeName
Obsolete.

Gets or sets the dependency type name.

Duration

Gets or sets the amount of time it took the application to handle the request.

Extension

Gets or sets gets the extension used to extend this telemetry instance using new strongly typed object.

Id

Gets or sets Dependency ID.

ItemTypeFlag

Gets item type for sampling evaluation.

Metrics

Gets a dictionary of application-defined event metrics. Learn more

Name

Gets or sets resource name.

ProactiveSamplingDecision

Gets or sets a value indicating whether item sampling decision was made pro-actively and result of this decision.

Properties

Gets a dictionary of application-defined property names and values providing additional information about this remote dependency. Learn more

ResultCode

Gets or sets the Result Code.

Sequence

Gets or sets the value that defines absolute order of the telemetry item.

StartTime
Obsolete.

Gets or sets the start time of the operation.

(Inherited from OperationTelemetry)
Success

Gets or sets a value indicating whether the dependency call was successful or not.

Target

Gets or sets target of dependency call. SQL server name, url host, etc.

Timestamp

Gets or sets date and time when telemetry was recorded.

Type

Gets or sets the dependency type name.

Methods

DeepClone()

Deeply clones a DependencyTelemetry object.

Sanitize()

Allow to call OperationTelemetry.Sanitize method from child classes.

(Inherited from OperationTelemetry)
SerializeData(ISerializationWriter)

Writes serialization info about the data class of the implementing type using the given ISerializationWriter.

TryGetOperationDetail(String, Object)

In specific collectors, objects are added to the dependency telemetry which may be useful to enhance DependencyTelemetry telemetry by ITelemetryInitializer implementations. Objects retrieved here are not automatically serialized and sent to the backend.

Explicit Interface Implementations

ISupportSampling.SamplingPercentage

Gets or sets data sampling percentage (between 0 and 100). Should be 100/n where n is an integer. Learn more

ITelemetry.Sanitize()

Sanitizes the properties based on constraints.

Extension Methods

GetEnvelopeName(ITelemetry)

Gets envelope name for ITelemetry object.

TrySetEnvelopeName(ITelemetry, String)

Sets envelope name for ITelemetry object.

Applies to