Show / Hide Table of Contents

Class TelemetryHelper

Provides support for sending Telemetry information to Application Insights.

Inheritance
System.Object
TelemetryHelper
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: CrashCABN.Shared
Assembly: CrashCABN.Shared.dll
Syntax
public static class TelemetryHelper

Properties

View Source

InvocationId

Gets or sets the InvocationId.

Declaration
public static Guid InvocationId { get; set; }
Property Value
Type Description
System.Guid
View Source

Logger

Gets or sets the optional additional logger.

Declaration
public static ILogger? Logger { get; set; }
Property Value
Type Description
System.Nullable<ILogger>

Methods

View Source

Flush()

Flushes the in-memory and any metrics gathering data.

Declaration
public static void Flush()
View Source

MonitorDiskSpace()

Creates a timer to monitor and report disk usage.

Declaration
public static void MonitorDiskSpace()
View Source

TrackCrashDownloadSize(Int64, Guid, Boolean, String)

Sends metric and text information about the worker host's working drive to Application Insights.

Declaration
public static void TrackCrashDownloadSize(long cabBytes, Guid crashId, bool passedDiskSpaceCheck, string driveLetter = "C:\\")
Parameters
Type Name Description
System.Int64 cabBytes

Cab size in bytes.

System.Guid crashId

The GUID for this crash.

System.Boolean passedDiskSpaceCheck

Boolean flag indicating whether the check for sufficient disk space passed.

System.String driveLetter

Drive letter for cab download.

View Source

TrackDiskPercentUsed(String)

Sends metric and text information about the worker host's working drive to Application Insights.

Declaration
public static void TrackDiskPercentUsed(string driveLetter = "C:\\")
Parameters
Type Name Description
System.String driveLetter

Drive letter for drive to report on.

View Source

TrackEvent(TelemetryHelper.Events, String, String)

Sends a standard event message to Application Insights.

Declaration
public static void TrackEvent(TelemetryHelper.Events telemetryEvent, string eventData, string result = null)
Parameters
Type Name Description
TelemetryHelper.Events telemetryEvent

Telemetry Event from events Enum.

System.String eventData

Event Information to send with telemetry event.

System.String result

Any specific results that correspond to the event data. (such as the result of the operation).

View Source

TrackException(Exception, String)

Sends an exception to Application Insights.

Declaration
public static void TrackException(Exception exception, string extendedMessage = null)
Parameters
Type Name Description
System.Exception exception

Exception to report.

System.String extendedMessage

Extended message to include with the exception in Application Insights.

View Source

TrackTrace(String, SeverityLevel)

Send a trace message for display in Diagnostic Search.

Declaration
public static void TrackTrace(string msg, SeverityLevel sevLvl = null)
Parameters
Type Name Description
System.String msg

The trace message to send.

SeverityLevel sevLvl

The severity level. Default: SeverityLevel.Information When provided, the message is logged to AppInsights as well as Azure logs.

  • View Source
In This Article
Back to top Generated by DocFX