TelemetryClient TelemetryClient Class

Send events, metrics and other telemetry to the Application Insights service.

Syntax

Declaration

public sealed class TelemetryClientPublic NotInheritable Class TelemetryClient

Inheritance Hierarchy

Constructors summary

Initializes a new instance of the TelemetryClient class. Send telemetry with the active configuration, usually loaded from ApplicationInsights.config.

Initializes a new instance of the TelemetryClient class. Send telemetry with the specified configuration.

Properties summary

Gets the current context that will be used to augment telemetry you send.

Gets or sets the default instrumentation key for all ITelemetry objects logged in this TelemetryClient.

Methods summary

Flushes the in-memory buffer.

Check to determine if the tracking is enabled.

Send information about availability of an application. Create a separate AvailabilityTelemetry instance for each call to TrackAvailability(AvailabilityTelemetry)

Send information about availability of an application.

Send information about external dependency call in the application. Create a separate DependencyTelemetry instance for each call to TrackDependency(DependencyTelemetry)

Send information about external dependency call in the application.

Send information about external dependency call in the application.

Send an EventTelemetry for display in Diagnostic Search and aggregation in Metrics Explorer. Create a separate EventTelemetry instance for each call to TrackEvent(EventTelemetry).

Send an EventTelemetry for display in Diagnostic Search and aggregation in Metrics Explorer.

Send an ExceptionTelemetry for display in Diagnostic Search. Create a separate ExceptionTelemetry instance for each call to TrackException(ExceptionTelemetry)

Send an ExceptionTelemetry for display in Diagnostic Search.

Send a MetricTelemetry for representing aggregated metric data. Create a separate MetricTelemetry instance for each call to TrackMetric(MetricTelemetry).

Send information about the page viewed in the application. Create a separate PageViewTelemetry instance for each call to TrackPageView(PageViewTelemetry).

Send information about the page viewed in the application.

Send information about a request handled by the application. Create a separate RequestTelemetry instance for each call to TrackRequest(RequestTelemetry).

Send information about a request handled by the application.

Send a trace message for display in Diagnostic Search. Create a separate TraceTelemetry instance for each call to TrackTrace(TraceTelemetry).

Send a trace message for display in Diagnostic Search.

Send a trace message for display in Diagnostic Search.

Send a trace message for display in Diagnostic Search.

Send a trace message for display in Diagnostic Search.

Constructors

Properties

  • Context
    Context

    Gets the current context that will be used to augment telemetry you send.

    public TelemetryContext Context { get; }Public ReadOnly Property Context As TelemetryContext

    Property Value

  • InstrumentationKey
    InstrumentationKey

    Gets or sets the default instrumentation key for all ITelemetry objects logged in this TelemetryClient.

    public string InstrumentationKey { get; set; }Public Property InstrumentationKey As String

    Property Value

Methods

  • Flush()
    Flush()

    Flushes the in-memory buffer.

    public void Flush()Public Sub Flush
  • IsEnabled()
    IsEnabled()

    Check to determine if the tracking is enabled.

    public bool IsEnabled()Public Function IsEnabled As Boolean

    Returns

  • TrackAvailability(AvailabilityTelemetry)
    TrackAvailability(AvailabilityTelemetry)

    Send information about availability of an application. Create a separate AvailabilityTelemetry instance for each call to TrackAvailability(AvailabilityTelemetry)

    public void TrackAvailability(AvailabilityTelemetry telemetry)Public Sub TrackAvailability(telemetry As AvailabilityTelemetry)

    Parameters

  • TrackAvailability(String, DateTimeOffset, TimeSpan, String, Boolean, String, IDictionary<String, String>, IDictionary<String, Double>)
    TrackAvailability(String, DateTimeOffset, TimeSpan, String, Boolean, String, IDictionary(Of String, String), IDictionary(Of String, Double))

    Send information about availability of an application.

    public void TrackAvailability(string name, DateTimeOffset timeStamp, TimeSpan duration, string runLocation, bool success, string message = null, IDictionary<string, string> properties = null, IDictionary<string, double> metrics = null)Public Sub TrackAvailability(name As String, timeStamp As DateTimeOffset, duration As TimeSpan, runLocation As String, success As Boolean, message As String = Nothing, properties As IDictionary(Of String, String) = Nothing, metrics As IDictionary(Of String, Double) = Nothing)

    Parameters

  • TrackDependency(DependencyTelemetry)
    TrackDependency(DependencyTelemetry)

    Send information about external dependency call in the application. Create a separate DependencyTelemetry instance for each call to TrackDependency(DependencyTelemetry)

    public void TrackDependency(DependencyTelemetry telemetry)Public Sub TrackDependency(telemetry As DependencyTelemetry)

    Parameters

  • TrackDependency(String, String, DateTimeOffset, TimeSpan, Boolean)
    TrackDependency(String, String, DateTimeOffset, TimeSpan, Boolean)

    Send information about external dependency call in the application.

    public void TrackDependency(string dependencyName, string commandName, DateTimeOffset startTime, TimeSpan duration, bool success)Public Sub TrackDependency(dependencyName As String, commandName As String, startTime As DateTimeOffset, duration As TimeSpan, success As Boolean)

    Parameters

  • TrackDependency(String, String, String, String, DateTimeOffset, TimeSpan, String, Boolean)
    TrackDependency(String, String, String, String, DateTimeOffset, TimeSpan, String, Boolean)

    Send information about external dependency call in the application.

    public void TrackDependency(string dependencyTypeName, string target, string dependencyName, string data, DateTimeOffset startTime, TimeSpan duration, string resultCode, bool success)Public Sub TrackDependency(dependencyTypeName As String, target As String, dependencyName As String, data As String, startTime As DateTimeOffset, duration As TimeSpan, resultCode As String, success As Boolean)

    Parameters

  • TrackEvent(EventTelemetry)
    TrackEvent(EventTelemetry)

    Send an EventTelemetry for display in Diagnostic Search and aggregation in Metrics Explorer. Create a separate EventTelemetry instance for each call to TrackEvent(EventTelemetry).

    public void TrackEvent(EventTelemetry telemetry)Public Sub TrackEvent(telemetry As EventTelemetry)

    Parameters

  • TrackEvent(String, IDictionary<String, String>, IDictionary<String, Double>)
    TrackEvent(String, IDictionary(Of String, String), IDictionary(Of String, Double))

    Send an EventTelemetry for display in Diagnostic Search and aggregation in Metrics Explorer.

    public void TrackEvent(string eventName, IDictionary<string, string> properties = null, IDictionary<string, double> metrics = null)Public Sub TrackEvent(eventName As String, properties As IDictionary(Of String, String) = Nothing, metrics As IDictionary(Of String, Double) = Nothing)

    Parameters

  • TrackException(ExceptionTelemetry)
    TrackException(ExceptionTelemetry)

    Send an ExceptionTelemetry for display in Diagnostic Search. Create a separate ExceptionTelemetry instance for each call to TrackException(ExceptionTelemetry)

    public void TrackException(ExceptionTelemetry telemetry)Public Sub TrackException(telemetry As ExceptionTelemetry)

    Parameters

  • TrackException(Exception, IDictionary<String, String>, IDictionary<String, Double>)
    TrackException(Exception, IDictionary(Of String, String), IDictionary(Of String, Double))

    Send an ExceptionTelemetry for display in Diagnostic Search.

    public void TrackException(Exception exception, IDictionary<string, string> properties = null, IDictionary<string, double> metrics = null)Public Sub TrackException(exception As Exception, properties As IDictionary(Of String, String) = Nothing, metrics As IDictionary(Of String, Double) = Nothing)

    Parameters

  • TrackMetric(MetricTelemetry)
    TrackMetric(MetricTelemetry)

    Send a MetricTelemetry for representing aggregated metric data. Create a separate MetricTelemetry instance for each call to TrackMetric(MetricTelemetry).

    public void TrackMetric(MetricTelemetry telemetry)Public Sub TrackMetric(telemetry As MetricTelemetry)

    Parameters

  • TrackPageView(PageViewTelemetry)
    TrackPageView(PageViewTelemetry)

    Send information about the page viewed in the application. Create a separate PageViewTelemetry instance for each call to TrackPageView(PageViewTelemetry).

    public void TrackPageView(PageViewTelemetry telemetry)Public Sub TrackPageView(telemetry As PageViewTelemetry)

    Parameters

  • TrackPageView(String)
    TrackPageView(String)

    Send information about the page viewed in the application.

    public void TrackPageView(string name)Public Sub TrackPageView(name As String)

    Parameters

  • TrackRequest(RequestTelemetry)
    TrackRequest(RequestTelemetry)

    Send information about a request handled by the application. Create a separate RequestTelemetry instance for each call to TrackRequest(RequestTelemetry).

    public void TrackRequest(RequestTelemetry request)Public Sub TrackRequest(request As RequestTelemetry)

    Parameters

  • TrackRequest(String, DateTimeOffset, TimeSpan, String, Boolean)
    TrackRequest(String, DateTimeOffset, TimeSpan, String, Boolean)

    Send information about a request handled by the application.

    public void TrackRequest(string name, DateTimeOffset startTime, TimeSpan duration, string responseCode, bool success)Public Sub TrackRequest(name As String, startTime As DateTimeOffset, duration As TimeSpan, responseCode As String, success As Boolean)

    Parameters

  • TrackTrace(TraceTelemetry)
    TrackTrace(TraceTelemetry)

    Send a trace message for display in Diagnostic Search. Create a separate TraceTelemetry instance for each call to TrackTrace(TraceTelemetry).

    public void TrackTrace(TraceTelemetry telemetry)Public Sub TrackTrace(telemetry As TraceTelemetry)

    Parameters

  • TrackTrace(String)
    TrackTrace(String)

    Send a trace message for display in Diagnostic Search.

    public void TrackTrace(string message)Public Sub TrackTrace(message As String)

    Parameters

  • TrackTrace(String, SeverityLevel)
    TrackTrace(String, SeverityLevel)

    Send a trace message for display in Diagnostic Search.

    public void TrackTrace(string message, SeverityLevel severityLevel)Public Sub TrackTrace(message As String, severityLevel As SeverityLevel)

    Parameters

  • TrackTrace(String, SeverityLevel, IDictionary<String, String>)
    TrackTrace(String, SeverityLevel, IDictionary(Of String, String))

    Send a trace message for display in Diagnostic Search.

    public void TrackTrace(string message, SeverityLevel severityLevel, IDictionary<string, string> properties)Public Sub TrackTrace(message As String, severityLevel As SeverityLevel, properties As IDictionary(Of String, String))

    Parameters

  • TrackTrace(String, IDictionary<String, String>)
    TrackTrace(String, IDictionary(Of String, String))

    Send a trace message for display in Diagnostic Search.

    public void TrackTrace(string message, IDictionary<string, string> properties)Public Sub TrackTrace(message As String, properties As IDictionary(Of String, String))

    Parameters

Details

Namespace

Microsoft.ApplicationInsights

Assembly

Microsoft.ApplicationInsights.dll