DependencyTelemetry DependencyTelemetry 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.ISupportSampling
type DependencyTelemetry = class
    inherit OperationTelemetry
    interface ITelemetry
    interface ISupportProperties
    interface ISupportSampling
    interface ISupportMetrics
Public NotInheritable Class DependencyTelemetry
Inherits OperationTelemetry
Implements ISupportSampling
Inheritance
DependencyTelemetryDependencyTelemetryDependencyTelemetry
Implements

Constructors

DependencyTelemetry() DependencyTelemetry() DependencyTelemetry()

Initializes a new instance of the DependencyTelemetry class.

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

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

DependencyTelemetry(String, String, String, String) DependencyTelemetry(String, String, String, String) 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) DependencyTelemetry(String, String, String, String, DateTimeOffset, TimeSpan, String, Boolean) 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 CommandName CommandName

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

Context Context Context

Gets the context associated with the current telemetry item.

Data Data Data

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

DependencyTypeName DependencyTypeName DependencyTypeName

Gets or sets the dependency type name.

Duration Duration Duration

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

Extension Extension Extension

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

Id Id Id

Gets or sets Dependency ID.

Metrics Metrics Metrics

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

Name Name Name

Gets or sets resource name.

Properties Properties Properties

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

ResultCode ResultCode ResultCode

Gets or sets the Result Code.

Sequence Sequence Sequence

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

StartTime StartTime StartTime

Gets or sets the start time of the operation.

(Inherited from OperationTelemetry)
Success Success Success

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

Target Target Target

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

Timestamp Timestamp Timestamp

Gets or sets date and time when telemetry was recorded.

Type Type Type

Gets or sets the dependency type name.

Methods

DeepClone() DeepClone() DeepClone()

Deeply clones a DependencyTelemetry object.

Sanitize() Sanitize() Sanitize()

Allow to call OperationTelemetry.Sanitize method from child classes.

(Inherited from OperationTelemetry)
SerializeData(ISerializationWriter) SerializeData(ISerializationWriter) SerializeData(ISerializationWriter)
TryGetOperationDetail(String, Object) TryGetOperationDetail(String, Object) 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 ISupportSampling.SamplingPercentage 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() ITelemetry.Sanitize() ITelemetry.Sanitize()

Sanitizes the properties based on constraints.

Applies to