Added pre-aggreation for Exception Telemetry

This commit is contained in:
Rajkumar Rangaraj 2020-03-16 21:56:35 -07:00
Родитель aee56cd437
Коммит f442adc1ca
15 изменённых файлов: 651 добавлений и 56 удалений

Просмотреть файл

@ -169,35 +169,24 @@ Microsoft.ApplicationInsights.DataContracts.ExceptionHandledAt.Platform = 2 -> M
Microsoft.ApplicationInsights.DataContracts.ExceptionHandledAt.Unhandled = 0 -> Microsoft.ApplicationInsights.DataContracts.ExceptionHandledAt
Microsoft.ApplicationInsights.DataContracts.ExceptionHandledAt.UserCode = 1 -> Microsoft.ApplicationInsights.DataContracts.ExceptionHandledAt
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Context.get -> Microsoft.ApplicationInsights.DataContracts.TelemetryContext
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.DeepClone() -> Microsoft.ApplicationInsights.Channel.ITelemetry
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Exception.get -> System.Exception
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Exception.set -> void
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.ExceptionDetailsInfoList.get -> System.Collections.Generic.IReadOnlyList<Microsoft.ApplicationInsights.DataContracts.ExceptionDetailsInfo>
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.ExceptionTelemetry() -> void
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.ExceptionTelemetry(System.Collections.Generic.IEnumerable<Microsoft.ApplicationInsights.DataContracts.ExceptionDetailsInfo> exceptionDetailsInfoList, Microsoft.ApplicationInsights.DataContracts.SeverityLevel? severityLevel, string problemId, System.Collections.Generic.IDictionary<string, string> properties, System.Collections.Generic.IDictionary<string, double> measurements) -> void
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.ExceptionTelemetry(System.Exception exception) -> void
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Extension.get -> Microsoft.ApplicationInsights.Extensibility.IExtension
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Extension.set -> void
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.HandledAt.get -> Microsoft.ApplicationInsights.DataContracts.ExceptionHandledAt
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.HandledAt.set -> void
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.ItemTypeFlag.get -> Microsoft.ApplicationInsights.DataContracts.SamplingTelemetryItemTypes
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Message.get -> string
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Message.set -> void
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Metrics.get -> System.Collections.Generic.IDictionary<string, double>
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.ProactiveSamplingDecision.get -> Microsoft.ApplicationInsights.DataContracts.SamplingDecision
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.ProactiveSamplingDecision.set -> void
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.ProblemId.get -> string
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.ProblemId.set -> void
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Properties.get -> System.Collections.Generic.IDictionary<string, string>
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Sequence.get -> string
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Sequence.set -> void
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.SerializeData(Microsoft.ApplicationInsights.Extensibility.ISerializationWriter serializationWriter) -> void
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.SetParsedStack(System.Diagnostics.StackFrame[] frames) -> void
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.SeverityLevel.get -> Microsoft.ApplicationInsights.DataContracts.SeverityLevel?
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.SeverityLevel.set -> void
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Timestamp.get -> System.DateTimeOffset
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Timestamp.set -> void
Microsoft.ApplicationInsights.DataContracts.IJsonWriter
Microsoft.ApplicationInsights.DataContracts.IJsonWriter.WriteComma() -> void
Microsoft.ApplicationInsights.DataContracts.IJsonWriter.WriteEndArray() -> void

Просмотреть файл

@ -1,3 +1,26 @@
Microsoft.ApplicationInsights.Extensibility.AutocollectedMetricsExtractor.MaxExceptionCloudRoleInstanceValuesToDiscover.get -> int
Microsoft.ApplicationInsights.Extensibility.AutocollectedMetricsExtractor.MaxExceptionCloudRoleInstanceValuesToDiscover.set -> void
Microsoft.ApplicationInsights.Extensibility.AutocollectedMetricsExtractor.MaxExceptionCloudRoleNameValuesToDiscover.get -> int
Microsoft.ApplicationInsights.Extensibility.AutocollectedMetricsExtractor.MaxExceptionCloudRoleNameValuesToDiscover.set -> void
override Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Context.get -> Microsoft.ApplicationInsights.DataContracts.TelemetryContext
override Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.DeepClone() -> Microsoft.ApplicationInsights.Channel.ITelemetry
override Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Duration.get -> System.TimeSpan
override Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Duration.set -> void
override Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Extension.get -> Microsoft.ApplicationInsights.Extensibility.IExtension
override Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Extension.set -> void
override Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Id.get -> string
override Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Id.set -> void
override Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Metrics.get -> System.Collections.Generic.IDictionary<string, double>
override Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Name.get -> string
override Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Name.set -> void
override Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Properties.get -> System.Collections.Generic.IDictionary<string, string>
override Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Sequence.get -> string
override Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Sequence.set -> void
override Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.SerializeData(Microsoft.ApplicationInsights.Extensibility.ISerializationWriter serializationWriter) -> void
override Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Success.get -> bool?
override Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Success.set -> void
override Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Timestamp.get -> System.DateTimeOffset
override Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Timestamp.set -> void
Microsoft.ApplicationInsights.Extensibility.Implementation.TelemetryExtensions
static Microsoft.ApplicationInsights.Extensibility.Implementation.TelemetryExtensions.GetEnvelopeName(this Microsoft.ApplicationInsights.Channel.ITelemetry telemetry) -> string
static Microsoft.ApplicationInsights.Extensibility.Implementation.TelemetryExtensions.TrySetEnvelopeName(this Microsoft.ApplicationInsights.Channel.ITelemetry telemetry, string envelopeName) -> bool

Просмотреть файл

@ -169,35 +169,24 @@ Microsoft.ApplicationInsights.DataContracts.ExceptionHandledAt.Platform = 2 -> M
Microsoft.ApplicationInsights.DataContracts.ExceptionHandledAt.Unhandled = 0 -> Microsoft.ApplicationInsights.DataContracts.ExceptionHandledAt
Microsoft.ApplicationInsights.DataContracts.ExceptionHandledAt.UserCode = 1 -> Microsoft.ApplicationInsights.DataContracts.ExceptionHandledAt
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Context.get -> Microsoft.ApplicationInsights.DataContracts.TelemetryContext
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.DeepClone() -> Microsoft.ApplicationInsights.Channel.ITelemetry
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Exception.get -> System.Exception
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Exception.set -> void
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.ExceptionDetailsInfoList.get -> System.Collections.Generic.IReadOnlyList<Microsoft.ApplicationInsights.DataContracts.ExceptionDetailsInfo>
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.ExceptionTelemetry() -> void
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.ExceptionTelemetry(System.Collections.Generic.IEnumerable<Microsoft.ApplicationInsights.DataContracts.ExceptionDetailsInfo> exceptionDetailsInfoList, Microsoft.ApplicationInsights.DataContracts.SeverityLevel? severityLevel, string problemId, System.Collections.Generic.IDictionary<string, string> properties, System.Collections.Generic.IDictionary<string, double> measurements) -> void
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.ExceptionTelemetry(System.Exception exception) -> void
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Extension.get -> Microsoft.ApplicationInsights.Extensibility.IExtension
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Extension.set -> void
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.HandledAt.get -> Microsoft.ApplicationInsights.DataContracts.ExceptionHandledAt
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.HandledAt.set -> void
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.ItemTypeFlag.get -> Microsoft.ApplicationInsights.DataContracts.SamplingTelemetryItemTypes
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Message.get -> string
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Message.set -> void
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Metrics.get -> System.Collections.Generic.IDictionary<string, double>
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.ProactiveSamplingDecision.get -> Microsoft.ApplicationInsights.DataContracts.SamplingDecision
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.ProactiveSamplingDecision.set -> void
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.ProblemId.get -> string
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.ProblemId.set -> void
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Properties.get -> System.Collections.Generic.IDictionary<string, string>
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Sequence.get -> string
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Sequence.set -> void
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.SerializeData(Microsoft.ApplicationInsights.Extensibility.ISerializationWriter serializationWriter) -> void
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.SetParsedStack(System.Diagnostics.StackFrame[] frames) -> void
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.SeverityLevel.get -> Microsoft.ApplicationInsights.DataContracts.SeverityLevel?
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.SeverityLevel.set -> void
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Timestamp.get -> System.DateTimeOffset
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Timestamp.set -> void
Microsoft.ApplicationInsights.DataContracts.IJsonWriter
Microsoft.ApplicationInsights.DataContracts.IJsonWriter.WriteComma() -> void
Microsoft.ApplicationInsights.DataContracts.IJsonWriter.WriteEndArray() -> void

Просмотреть файл

@ -1,3 +1,26 @@
Microsoft.ApplicationInsights.Extensibility.AutocollectedMetricsExtractor.MaxExceptionCloudRoleInstanceValuesToDiscover.get -> int
Microsoft.ApplicationInsights.Extensibility.AutocollectedMetricsExtractor.MaxExceptionCloudRoleInstanceValuesToDiscover.set -> void
Microsoft.ApplicationInsights.Extensibility.AutocollectedMetricsExtractor.MaxExceptionCloudRoleNameValuesToDiscover.get -> int
Microsoft.ApplicationInsights.Extensibility.AutocollectedMetricsExtractor.MaxExceptionCloudRoleNameValuesToDiscover.set -> void
override Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Context.get -> Microsoft.ApplicationInsights.DataContracts.TelemetryContext
override Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.DeepClone() -> Microsoft.ApplicationInsights.Channel.ITelemetry
override Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Duration.get -> System.TimeSpan
override Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Duration.set -> void
override Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Extension.get -> Microsoft.ApplicationInsights.Extensibility.IExtension
override Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Extension.set -> void
override Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Id.get -> string
override Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Id.set -> void
override Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Metrics.get -> System.Collections.Generic.IDictionary<string, double>
override Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Name.get -> string
override Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Name.set -> void
override Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Properties.get -> System.Collections.Generic.IDictionary<string, string>
override Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Sequence.get -> string
override Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Sequence.set -> void
override Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.SerializeData(Microsoft.ApplicationInsights.Extensibility.ISerializationWriter serializationWriter) -> void
override Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Success.get -> bool?
override Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Success.set -> void
override Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Timestamp.get -> System.DateTimeOffset
override Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Timestamp.set -> void
Microsoft.ApplicationInsights.Extensibility.Implementation.TelemetryExtensions
static Microsoft.ApplicationInsights.Extensibility.Implementation.TelemetryExtensions.GetEnvelopeName(this Microsoft.ApplicationInsights.Channel.ITelemetry telemetry) -> string
static Microsoft.ApplicationInsights.Extensibility.Implementation.TelemetryExtensions.TrySetEnvelopeName(this Microsoft.ApplicationInsights.Channel.ITelemetry telemetry, string envelopeName) -> bool

Просмотреть файл

@ -169,35 +169,24 @@ Microsoft.ApplicationInsights.DataContracts.ExceptionHandledAt.Platform = 2 -> M
Microsoft.ApplicationInsights.DataContracts.ExceptionHandledAt.Unhandled = 0 -> Microsoft.ApplicationInsights.DataContracts.ExceptionHandledAt
Microsoft.ApplicationInsights.DataContracts.ExceptionHandledAt.UserCode = 1 -> Microsoft.ApplicationInsights.DataContracts.ExceptionHandledAt
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Context.get -> Microsoft.ApplicationInsights.DataContracts.TelemetryContext
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.DeepClone() -> Microsoft.ApplicationInsights.Channel.ITelemetry
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Exception.get -> System.Exception
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Exception.set -> void
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.ExceptionDetailsInfoList.get -> System.Collections.Generic.IReadOnlyList<Microsoft.ApplicationInsights.DataContracts.ExceptionDetailsInfo>
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.ExceptionTelemetry() -> void
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.ExceptionTelemetry(System.Collections.Generic.IEnumerable<Microsoft.ApplicationInsights.DataContracts.ExceptionDetailsInfo> exceptionDetailsInfoList, Microsoft.ApplicationInsights.DataContracts.SeverityLevel? severityLevel, string problemId, System.Collections.Generic.IDictionary<string, string> properties, System.Collections.Generic.IDictionary<string, double> measurements) -> void
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.ExceptionTelemetry(System.Exception exception) -> void
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Extension.get -> Microsoft.ApplicationInsights.Extensibility.IExtension
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Extension.set -> void
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.HandledAt.get -> Microsoft.ApplicationInsights.DataContracts.ExceptionHandledAt
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.HandledAt.set -> void
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.ItemTypeFlag.get -> Microsoft.ApplicationInsights.DataContracts.SamplingTelemetryItemTypes
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Message.get -> string
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Message.set -> void
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Metrics.get -> System.Collections.Generic.IDictionary<string, double>
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.ProactiveSamplingDecision.get -> Microsoft.ApplicationInsights.DataContracts.SamplingDecision
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.ProactiveSamplingDecision.set -> void
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.ProblemId.get -> string
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.ProblemId.set -> void
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Properties.get -> System.Collections.Generic.IDictionary<string, string>
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Sequence.get -> string
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Sequence.set -> void
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.SerializeData(Microsoft.ApplicationInsights.Extensibility.ISerializationWriter serializationWriter) -> void
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.SetParsedStack(System.Diagnostics.StackFrame[] frames) -> void
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.SeverityLevel.get -> Microsoft.ApplicationInsights.DataContracts.SeverityLevel?
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.SeverityLevel.set -> void
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Timestamp.get -> System.DateTimeOffset
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Timestamp.set -> void
Microsoft.ApplicationInsights.DataContracts.IJsonWriter
Microsoft.ApplicationInsights.DataContracts.IJsonWriter.WriteComma() -> void
Microsoft.ApplicationInsights.DataContracts.IJsonWriter.WriteEndArray() -> void

Просмотреть файл

@ -1,3 +1,26 @@
Microsoft.ApplicationInsights.Extensibility.AutocollectedMetricsExtractor.MaxExceptionCloudRoleInstanceValuesToDiscover.get -> int
Microsoft.ApplicationInsights.Extensibility.AutocollectedMetricsExtractor.MaxExceptionCloudRoleInstanceValuesToDiscover.set -> void
Microsoft.ApplicationInsights.Extensibility.AutocollectedMetricsExtractor.MaxExceptionCloudRoleNameValuesToDiscover.get -> int
Microsoft.ApplicationInsights.Extensibility.AutocollectedMetricsExtractor.MaxExceptionCloudRoleNameValuesToDiscover.set -> void
override Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Context.get -> Microsoft.ApplicationInsights.DataContracts.TelemetryContext
override Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.DeepClone() -> Microsoft.ApplicationInsights.Channel.ITelemetry
override Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Duration.get -> System.TimeSpan
override Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Duration.set -> void
override Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Extension.get -> Microsoft.ApplicationInsights.Extensibility.IExtension
override Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Extension.set -> void
override Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Id.get -> string
override Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Id.set -> void
override Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Metrics.get -> System.Collections.Generic.IDictionary<string, double>
override Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Name.get -> string
override Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Name.set -> void
override Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Properties.get -> System.Collections.Generic.IDictionary<string, string>
override Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Sequence.get -> string
override Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Sequence.set -> void
override Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.SerializeData(Microsoft.ApplicationInsights.Extensibility.ISerializationWriter serializationWriter) -> void
override Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Success.get -> bool?
override Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Success.set -> void
override Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Timestamp.get -> System.DateTimeOffset
override Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Timestamp.set -> void
Microsoft.ApplicationInsights.Extensibility.Implementation.TelemetryExtensions
static Microsoft.ApplicationInsights.Extensibility.Implementation.TelemetryExtensions.GetEnvelopeName(this Microsoft.ApplicationInsights.Channel.ITelemetry telemetry) -> string
static Microsoft.ApplicationInsights.Extensibility.Implementation.TelemetryExtensions.TrySetEnvelopeName(this Microsoft.ApplicationInsights.Channel.ITelemetry telemetry, string envelopeName) -> bool

Просмотреть файл

@ -169,35 +169,24 @@ Microsoft.ApplicationInsights.DataContracts.ExceptionHandledAt.Platform = 2 -> M
Microsoft.ApplicationInsights.DataContracts.ExceptionHandledAt.Unhandled = 0 -> Microsoft.ApplicationInsights.DataContracts.ExceptionHandledAt
Microsoft.ApplicationInsights.DataContracts.ExceptionHandledAt.UserCode = 1 -> Microsoft.ApplicationInsights.DataContracts.ExceptionHandledAt
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Context.get -> Microsoft.ApplicationInsights.DataContracts.TelemetryContext
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.DeepClone() -> Microsoft.ApplicationInsights.Channel.ITelemetry
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Exception.get -> System.Exception
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Exception.set -> void
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.ExceptionDetailsInfoList.get -> System.Collections.Generic.IReadOnlyList<Microsoft.ApplicationInsights.DataContracts.ExceptionDetailsInfo>
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.ExceptionTelemetry() -> void
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.ExceptionTelemetry(System.Collections.Generic.IEnumerable<Microsoft.ApplicationInsights.DataContracts.ExceptionDetailsInfo> exceptionDetailsInfoList, Microsoft.ApplicationInsights.DataContracts.SeverityLevel? severityLevel, string problemId, System.Collections.Generic.IDictionary<string, string> properties, System.Collections.Generic.IDictionary<string, double> measurements) -> void
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.ExceptionTelemetry(System.Exception exception) -> void
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Extension.get -> Microsoft.ApplicationInsights.Extensibility.IExtension
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Extension.set -> void
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.HandledAt.get -> Microsoft.ApplicationInsights.DataContracts.ExceptionHandledAt
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.HandledAt.set -> void
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.ItemTypeFlag.get -> Microsoft.ApplicationInsights.DataContracts.SamplingTelemetryItemTypes
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Message.get -> string
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Message.set -> void
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Metrics.get -> System.Collections.Generic.IDictionary<string, double>
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.ProactiveSamplingDecision.get -> Microsoft.ApplicationInsights.DataContracts.SamplingDecision
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.ProactiveSamplingDecision.set -> void
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.ProblemId.get -> string
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.ProblemId.set -> void
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Properties.get -> System.Collections.Generic.IDictionary<string, string>
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Sequence.get -> string
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Sequence.set -> void
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.SerializeData(Microsoft.ApplicationInsights.Extensibility.ISerializationWriter serializationWriter) -> void
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.SetParsedStack(System.Diagnostics.StackFrame[] frames) -> void
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.SeverityLevel.get -> Microsoft.ApplicationInsights.DataContracts.SeverityLevel?
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.SeverityLevel.set -> void
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Timestamp.get -> System.DateTimeOffset
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Timestamp.set -> void
Microsoft.ApplicationInsights.DataContracts.IJsonWriter
Microsoft.ApplicationInsights.DataContracts.IJsonWriter.WriteComma() -> void
Microsoft.ApplicationInsights.DataContracts.IJsonWriter.WriteEndArray() -> void

Просмотреть файл

@ -1,3 +1,26 @@
Microsoft.ApplicationInsights.Extensibility.AutocollectedMetricsExtractor.MaxExceptionCloudRoleInstanceValuesToDiscover.get -> int
Microsoft.ApplicationInsights.Extensibility.AutocollectedMetricsExtractor.MaxExceptionCloudRoleInstanceValuesToDiscover.set -> void
Microsoft.ApplicationInsights.Extensibility.AutocollectedMetricsExtractor.MaxExceptionCloudRoleNameValuesToDiscover.get -> int
Microsoft.ApplicationInsights.Extensibility.AutocollectedMetricsExtractor.MaxExceptionCloudRoleNameValuesToDiscover.set -> void
override Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Context.get -> Microsoft.ApplicationInsights.DataContracts.TelemetryContext
override Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.DeepClone() -> Microsoft.ApplicationInsights.Channel.ITelemetry
override Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Duration.get -> System.TimeSpan
override Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Duration.set -> void
override Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Extension.get -> Microsoft.ApplicationInsights.Extensibility.IExtension
override Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Extension.set -> void
override Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Id.get -> string
override Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Id.set -> void
override Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Metrics.get -> System.Collections.Generic.IDictionary<string, double>
override Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Name.get -> string
override Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Name.set -> void
override Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Properties.get -> System.Collections.Generic.IDictionary<string, string>
override Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Sequence.get -> string
override Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Sequence.set -> void
override Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.SerializeData(Microsoft.ApplicationInsights.Extensibility.ISerializationWriter serializationWriter) -> void
override Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Success.get -> bool?
override Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Success.set -> void
override Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Timestamp.get -> System.DateTimeOffset
override Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.Timestamp.set -> void
Microsoft.ApplicationInsights.Extensibility.Implementation.TelemetryExtensions
static Microsoft.ApplicationInsights.Extensibility.Implementation.TelemetryExtensions.GetEnvelopeName(this Microsoft.ApplicationInsights.Channel.ITelemetry telemetry) -> string
static Microsoft.ApplicationInsights.Extensibility.Implementation.TelemetryExtensions.TrySetEnvelopeName(this Microsoft.ApplicationInsights.Channel.ITelemetry telemetry, string envelopeName) -> bool

Просмотреть файл

@ -36,12 +36,15 @@
(req as ISupportSampling).SamplingPercentage = 1;
var dep = new DependencyTelemetry("Type", "Target", "depName1", "data", DateTimeOffset.Now, TimeSpan.FromMilliseconds(1000), "ResultCode100", true);
(dep as ISupportSampling).SamplingPercentage = 1;
var exp = new ExceptionTelemetry(new ArgumentException("Test"));
(exp as ISupportSampling).SamplingPercentage = 1;
client.TrackRequest(req);
client.TrackDependency(dep);
client.TrackException(exp);
}
Assert.AreEqual(2, telemetrySentToChannel.Count);
Assert.AreEqual(3, telemetrySentToChannel.Count);
// Validate that Preaggregator does not process items which are sampled.
AssertEx.IsType<RequestTelemetry>(telemetrySentToChannel[0]);
@ -54,6 +57,11 @@
Assert.AreEqual(false,
((DependencyTelemetry)telemetrySentToChannel[1]).Properties.ContainsKey("_MS.ProcessedByMetricExtractors"));
AssertEx.IsType<ExceptionTelemetry>(telemetrySentToChannel[2]);
Assert.AreEqual(false, ((ExceptionTelemetry)telemetrySentToChannel[2]).Properties.ContainsKey("_MS.ProcessedByMetricExtractors"));
Assert.AreEqual(false,
((ExceptionTelemetry)telemetrySentToChannel[2]).Properties.ContainsKey("_MS.ProcessedByMetricExtractors"));
}
[TestMethod]
@ -472,6 +480,14 @@
return dep;
}
private ExceptionTelemetry CreateExceptionTelemetry(Exception exception, string role, string instance)
{
var exp = new ExceptionTelemetry(exception);
exp.Context.Cloud.RoleName = role;
exp.Context.Cloud.RoleInstance = instance;
return exp;
}
private void ValidateAllMetric(IEnumerable<ITelemetry> metricCollection)
{
foreach (var singleMetric in metricCollection)
@ -941,6 +957,243 @@
#endregion Dependency-metrics-related Tests
#region Exception-metrics-related Tests
[TestMethod]
public void Exception_TelemetryMarkedAsProcessedCorrectly()
{
List<ITelemetry> telemetrySentToChannel = new List<ITelemetry>();
Func<ITelemetryProcessor, AutocollectedMetricsExtractor> extractorFactory = (nextProc) => new AutocollectedMetricsExtractor(nextProc);
TelemetryConfiguration telemetryConfig = CreateTelemetryConfigWithExtractor(telemetrySentToChannel, extractorFactory);
using (telemetryConfig)
{
TelemetryClient client = new TelemetryClient(telemetryConfig);
client.TrackEvent("Test Event");
client.TrackException(new ExceptionTelemetry(new NullReferenceException("Test")));
client.TrackException(new ExceptionTelemetry(new ArgumentException("Test")));
}
Assert.AreEqual(4, telemetrySentToChannel.Count);
}
[TestMethod]
public void Exception_TelemetryRespectsDimLimitCloudRoleInstance()
{
List<ITelemetry> telemetrySentToChannel = new List<ITelemetry>();
Func<ITelemetryProcessor, AutocollectedMetricsExtractor> extractorFactory =
(nextProc) => {
var metricExtractor = new AutocollectedMetricsExtractor(nextProc);
metricExtractor.MaxExceptionCloudRoleInstanceValuesToDiscover = 2;
return metricExtractor;
};
TelemetryConfiguration telemetryConfig = CreateTelemetryConfigWithExtractor(telemetrySentToChannel, extractorFactory);
using (telemetryConfig)
{
TelemetryClient client = new TelemetryClient(telemetryConfig);
// Track 4 exceptions with 3 different values for RoleInstance - A B C D.
// As MaxExceptionCloudRoleInstanceValuesToDiscover = 2, the first 2 values encountered (A,B)
// will be used as such at which the DimensionCap is hit.
// Newly incoming values (C,D) will be rolled into "DIMENSION-CAPPED"
client.TrackException(CreateExceptionTelemetry(
new ArgumentException("Test A"), "RoleNameA", "RoleInstanceA"));
client.TrackException(CreateExceptionTelemetry(
new NullReferenceException("Test B"), "RoleNameA", "RoleInstanceB"));
client.TrackException(CreateExceptionTelemetry(
new NullReferenceException("Test C"), "RoleNameA", "RoleInstanceC"));
client.TrackException(CreateExceptionTelemetry(
new ArgumentException("Test D"), "RoleNameA", "RoleInstanceD"));
}
// 4 requests + 3 metric
Assert.AreEqual(7, telemetrySentToChannel.Count);
AssertEx.IsType<ExceptionTelemetry>(telemetrySentToChannel[0]);
Assert.AreEqual("Test A", ((ExceptionTelemetry)telemetrySentToChannel[0]).Exception.Message);
Assert.AreEqual(true, ((ExceptionTelemetry)telemetrySentToChannel[0]).Properties.ContainsKey("_MS.ProcessedByMetricExtractors"));
Assert.AreEqual("(Name:'Exceptions', Ver:'1.1')",
((ExceptionTelemetry)telemetrySentToChannel[0]).Properties["_MS.ProcessedByMetricExtractors"]);
AssertEx.IsType<ExceptionTelemetry>(telemetrySentToChannel[1]);
Assert.AreEqual("Test B", ((ExceptionTelemetry)telemetrySentToChannel[1]).Exception.Message);
Assert.AreEqual(true, ((ExceptionTelemetry)telemetrySentToChannel[1]).Properties.ContainsKey("_MS.ProcessedByMetricExtractors"));
Assert.AreEqual("(Name:'Exceptions', Ver:'1.1')",
((ExceptionTelemetry)telemetrySentToChannel[1]).Properties["_MS.ProcessedByMetricExtractors"]);
AssertEx.IsType<ExceptionTelemetry>(telemetrySentToChannel[2]);
Assert.AreEqual("Test C", ((ExceptionTelemetry)telemetrySentToChannel[2]).Exception.Message);
Assert.AreEqual(true, ((ExceptionTelemetry)telemetrySentToChannel[2]).Properties.ContainsKey("_MS.ProcessedByMetricExtractors"));
Assert.AreEqual("(Name:'Exceptions', Ver:'1.1')",
((ExceptionTelemetry)telemetrySentToChannel[2]).Properties["_MS.ProcessedByMetricExtractors"]);
AssertEx.IsType<ExceptionTelemetry>(telemetrySentToChannel[3]);
Assert.AreEqual("Test D", ((ExceptionTelemetry)telemetrySentToChannel[3]).Exception.Message);
Assert.AreEqual(true, ((ExceptionTelemetry)telemetrySentToChannel[3]).Properties.ContainsKey("_MS.ProcessedByMetricExtractors"));
Assert.AreEqual("(Name:'Exceptions', Ver:'1.1')",
((ExceptionTelemetry)telemetrySentToChannel[3]).Properties["_MS.ProcessedByMetricExtractors"]);
for (int i = 4; i < 7; i++)
{
AssertEx.IsType<MetricTelemetry>(telemetrySentToChannel[i]);
var metricTel = telemetrySentToChannel[i] as MetricTelemetry;
// validate standard fields
Assert.IsTrue(metricTel.Properties.ContainsKey("_MS.AggregationIntervalMs"));
Assert.IsTrue(metricTel.Context.GlobalProperties.ContainsKey("_MS.IsAutocollected"));
Assert.AreEqual("True", metricTel.Context.GlobalProperties["_MS.IsAutocollected"]);
Assert.IsTrue(metricTel.Context.GlobalProperties.ContainsKey("_MS.MetricId"));
Assert.AreEqual("exceptions/count", metricTel.Context.GlobalProperties["_MS.MetricId"]);
// validate dimensions exist
Assert.AreEqual(true, metricTel.Properties.ContainsKey("cloud/roleInstance"));
Assert.AreEqual(true, metricTel.Properties.ContainsKey("cloud/roleName"));
}
// We expect RoleInstanceA to be tracked correctly
var cloudRoleInstanceA = telemetrySentToChannel.Where(
(tel) => "Exceptions".Equals((tel as MetricTelemetry)?.Name)
&& (tel as MetricTelemetry).Properties.Contains(new KeyValuePair<string, string>("cloud/roleInstance", "RoleInstanceA")));
Assert.IsTrue(cloudRoleInstanceA.Count() == 1);
// We expect RoleInstanceB to be tracked correctly
var cloudRoleInstanceB = telemetrySentToChannel.Where(
(tel) => "Exceptions".Equals((tel as MetricTelemetry)?.Name)
&& (tel as MetricTelemetry).Properties.Contains(new KeyValuePair<string, string>("cloud/roleInstance", "RoleInstanceB")));
Assert.IsTrue(cloudRoleInstanceB.Count() == 1);
// We expect RoleInstanceC to be not present as a dimension, as dimension cap of 2 is already hit.
var cloudRoleInstanceC = telemetrySentToChannel.Where(
(tel) => "Exceptions".Equals((tel as MetricTelemetry)?.Name)
&& (tel as MetricTelemetry).Properties.Contains(new KeyValuePair<string, string>("cloud/roleInstance", "RoleInstanceC")));
Assert.IsTrue(cloudRoleInstanceC.Count() == 0);
// We expect RoleInstanceD to be not present as a dimension, as dimension cap of 2 is already hit.
var cloudRoleInstanceD = telemetrySentToChannel.Where(
(tel) => "Exceptions".Equals((tel as MetricTelemetry)?.Name)
&& (tel as MetricTelemetry).Properties.Contains(new KeyValuePair<string, string>("cloud/roleInstance", "RoleInstanceD")));
Assert.IsTrue(cloudRoleInstanceD.Count() == 0);
// We expect a DIMENSION-CAPPED series, which represents RoleInstanceC and RoleInstanceD
var dimCappedSeries = telemetrySentToChannel.Where(
(tel) => "Exceptions".Equals((tel as MetricTelemetry)?.Name)
&& (tel as MetricTelemetry).Properties.Contains(new KeyValuePair<string, string>("cloud/roleInstance", "DIMENSION-CAPPED")));
Assert.IsTrue(dimCappedSeries.Count() == 1);
}
[TestMethod]
public void Exception_CorrectlyExtractsMetric()
{
List<ITelemetry> telemetrySentToChannel = new List<ITelemetry>();
Func<ITelemetryProcessor, AutocollectedMetricsExtractor> extractorFactory = (nextProc) => new AutocollectedMetricsExtractor(nextProc);
// default set of dimensions with test values.
string[] cloudRoleNames = new string[] { "RoleA", "RoleB" };
string[] cloudRoleInstances = new string[] { "RoleInstanceA", "RoleInstanceB" };
TelemetryConfiguration telemetryConfig = CreateTelemetryConfigWithExtractor(telemetrySentToChannel, extractorFactory);
using (telemetryConfig)
{
TelemetryClient client = new TelemetryClient(telemetryConfig);
List<ExceptionTelemetry> exceptions = new List<ExceptionTelemetry>();
// Produces telemetry with every combination of dimension values.
for (int i = 0; i < cloudRoleNames.Length; i++)
{
for (int j = 0; j < cloudRoleInstances.Length; j++)
{
exceptions.Add(CreateExceptionTelemetry(
new NullReferenceException("Test"), cloudRoleNames[i], cloudRoleInstances[j]));
exceptions.Add(CreateExceptionTelemetry(
new ArgumentException("Test"), cloudRoleNames[i], cloudRoleInstances[j]));
exceptions.Add(CreateExceptionTelemetry(
new NullReferenceException("Test"), cloudRoleNames[i], cloudRoleInstances[j]));
exceptions.Add(CreateExceptionTelemetry(
new ArgumentException("Test"), cloudRoleNames[i], cloudRoleInstances[j]));
}
}
foreach (var exp in exceptions)
{
client.TrackException(exp);
}
// The # of iteration is 4 = 2 * 2
// RoleName * RoleInstance
// 4 Track calls are made in every iteration,
// hence 4 * 4 requests gives 16 total requests
Assert.AreEqual(16, telemetrySentToChannel.Count);
// The total # of timeseries is 4
// 2 * 2 = 4
// RoleInstance
// Duration bucket is auto calculated, hence not included in iteration count.
// The above did not include Metrics as they are sent upon dispose only.
} // dispose occurs here, and hence metrics get flushed out.
// 2 * 2 = 4
// RoleName * RoleInstance
int totalTimeSeries = 4;
// 20 = 16 exceptions + 4 metrics as there are 4 unique combination of dimension
Assert.AreEqual(20, telemetrySentToChannel.Count);
// These are pre-agg metric
var serverExceptionMetric = telemetrySentToChannel.Where(
(tel) => "Exceptions".Equals((tel as MetricTelemetry)?.Name));
Assert.AreEqual(totalTimeSeries, serverExceptionMetric.Count());
foreach (var metric in serverExceptionMetric)
{
var metricTel = metric as MetricTelemetry;
// validate standard fields
Assert.IsTrue(metricTel.Properties.ContainsKey("_MS.AggregationIntervalMs"));
Assert.IsTrue(metricTel.Context.GlobalProperties.ContainsKey("_MS.IsAutocollected"));
Assert.AreEqual("True", metricTel.Context.GlobalProperties["_MS.IsAutocollected"]);
Assert.IsTrue(metricTel.Context.GlobalProperties.ContainsKey("_MS.MetricId"));
Assert.AreEqual("exceptions/count", metricTel.Context.GlobalProperties["_MS.MetricId"]);
// validate dimensions exist
Assert.AreEqual(true, metricTel.Properties.ContainsKey("cloud/roleInstance"));
Assert.AreEqual(true, metricTel.Properties.ContainsKey("cloud/roleName"));
}
// Validate RoleName dimesion
for (int i = 0; i < cloudRoleNames.Length; i++)
{
var metricCollection = serverExceptionMetric.Where(
(tel) => (tel as MetricTelemetry).Properties["cloud/roleName"] == cloudRoleNames[i]);
int expectedCount = totalTimeSeries / cloudRoleNames.Length;
Assert.AreEqual(expectedCount, metricCollection.Count());
}
// Validate RoleInstance dimension
for (int i = 0; i < cloudRoleInstances.Length; i++)
{
var metricCollection = serverExceptionMetric.Where(
(tel) => (tel as MetricTelemetry).Properties["cloud/roleInstance"] == cloudRoleInstances[i]);
int expectedCount = totalTimeSeries / cloudRoleInstances.Length;
Assert.AreEqual(expectedCount, metricCollection.Count());
}
}
[TestMethod]
public void Exception_DefaultDimensionLimitsValidation()
{
var reqExtractor = new ExceptionMetricsExtractor();
Assert.AreEqual(2, reqExtractor.MaxCloudRoleNameValuesToDiscover);
Assert.AreEqual(2, reqExtractor.MaxCloudRoleInstanceValuesToDiscover);
}
#endregion Exception-metrics-related Tests
#region Common Tools
internal static TelemetryConfiguration CreateTelemetryConfigWithExtractor(IList<ITelemetry> telemetrySentToChannel,

Просмотреть файл

@ -8,6 +8,7 @@
using Microsoft.ApplicationInsights.Extensibility;
using Microsoft.ApplicationInsights.Extensibility.Implementation;
using Microsoft.ApplicationInsights.Extensibility.Implementation.External;
using Microsoft.ApplicationInsights.Extensibility.Implementation.Metrics;
/// <summary>
/// Telemetry type used to track exceptions. This will capture TypeName, Message, and CallStack.
@ -16,7 +17,7 @@
/// <remarks>
/// Additional exception details will need to be tracked manually.
/// </remarks>
public sealed class ExceptionTelemetry : ITelemetry, ISupportProperties, ISupportAdvancedSampling, ISupportMetrics, IAiSerializableTelemetry
public sealed class ExceptionTelemetry : OperationTelemetry, ITelemetry, ISupportProperties, ISupportAdvancedSampling, ISupportMetrics, IAiSerializableTelemetry
{
internal string EnvelopeName = "AppExceptions";
@ -118,17 +119,17 @@
/// <summary>
/// Gets or sets date and time when telemetry was recorded.
/// </summary>
public DateTimeOffset Timestamp { get; set; }
public override DateTimeOffset Timestamp { get; set; }
/// <summary>
/// Gets or sets the value that defines absolute order of the telemetry item.
/// </summary>
public string Sequence { get; set; }
public override string Sequence { get; set; }
/// <summary>
/// Gets the context associated with the current telemetry item.
/// </summary>
public TelemetryContext Context
public override TelemetryContext Context
{
get { return this.context; }
}
@ -136,12 +137,30 @@
/// <summary>
/// Gets or sets gets the extension used to extend this telemetry instance using new strong typed object.
/// </summary>
public IExtension Extension
public override IExtension Extension
{
get { return this.extension; }
set { this.extension = value; }
}
/// <summary>
/// Gets or sets ID.
/// </summary>
public override string Id
{
get;
set;
}
/// <summary>
/// Gets or sets human-readable name of the exception.
/// </summary>
public override string Name
{
get;
set;
}
/// <summary>
/// Gets or sets the problemId.
/// </summary>
@ -246,7 +265,7 @@
/// Gets a dictionary of application-defined exception metrics.
/// <a href="https://go.microsoft.com/fwlink/?linkid=525722#properties">Learn more</a>
/// </summary>
public IDictionary<string, double> Metrics
public override IDictionary<string, double> Metrics
{
get { return this.Data.Measurements; }
}
@ -261,9 +280,37 @@
/// Gets a dictionary of application-defined property names and values providing additional information about this exception.
/// <a href="https://go.microsoft.com/fwlink/?linkid=525722#properties">Learn more</a>
/// </summary>
public IDictionary<string, string> Properties
public override IDictionary<string, string> Properties
{
get { return this.Data.Properties; }
#pragma warning disable CS0618 // Type or member is obsolete
get
{
if (!string.IsNullOrEmpty(this.MetricExtractorInfo) && !this.Context.Properties.ContainsKey(MetricTerms.Extraction.ProcessedByExtractors.Moniker.Key))
{
this.Context.Properties[MetricTerms.Extraction.ProcessedByExtractors.Moniker.Key] = this.MetricExtractorInfo;
}
return this.Context.Properties;
#pragma warning restore CS0618 // Type or member is obsolete
}
}
/// <summary>
/// Gets or sets the amount of time it took the application to handle the exception.
/// </summary>
public override TimeSpan Duration
{
get;
set;
}
/// <summary>
/// Gets or sets a value indicating whether application handled the exception successfully.
/// </summary>
public override bool? Success
{
get;
set;
}
/// <summary>
@ -298,17 +345,26 @@
get { return this.Data.Data.exceptions; }
}
/// <summary>
/// Gets or sets the MetricExtractorInfo.
/// </summary>
internal string MetricExtractorInfo
{
get;
set;
}
/// <summary>
/// Deeply clones a <see cref="ExceptionTelemetry"/> object.
/// </summary>
/// <returns>A cloned instance.</returns>
public ITelemetry DeepClone()
public override ITelemetry DeepClone()
{
return new ExceptionTelemetry(this);
}
/// <inheritdoc/>
public void SerializeData(ISerializationWriter serializationWriter)
public override void SerializeData(ISerializationWriter serializationWriter)
{
if (serializationWriter == null)
{

Просмотреть файл

@ -31,6 +31,7 @@
// List of all participating extractors that take care of specific metrics kinds:
private readonly RequestMetricsExtractor extractorForRequestMetrics;
private readonly DependencyMetricsExtractor extractorForDependencyMetrics;
private readonly ExceptionMetricsExtractor extractorForExceptionMetrics;
/// <summary>
/// We have dedicated instance variables to refer to each individual extractors because we are exposing some of their properties to the config subsystem here.
@ -69,11 +70,13 @@
this.extractorForRequestMetrics = new RequestMetricsExtractor();
this.extractorForDependencyMetrics = new DependencyMetricsExtractor();
this.extractorForExceptionMetrics = new ExceptionMetricsExtractor();
this.extractors = new ExtractorWithInfo[]
{
new ExtractorWithInfo(this.extractorForRequestMetrics, GetExtractorInfo(this.extractorForRequestMetrics)),
new ExtractorWithInfo(this.extractorForDependencyMetrics, GetExtractorInfo(this.extractorForDependencyMetrics)),
new ExtractorWithInfo(this.extractorForExceptionMetrics, GetExtractorInfo(this.extractorForExceptionMetrics)),
};
}
@ -192,6 +195,52 @@
}
}
/// <summary>
/// Gets or sets the maximum distinct values for CloudRoleInstance for Exception telemetry.
/// Values encountered after this limit is hit will be collapsed into a single value DIMENSION_CAPPED.
/// Setting 0 will all values to be replaced with a single value "Other".
/// </summary>
public int MaxExceptionCloudRoleInstanceValuesToDiscover
{
get
{
return this.extractorForExceptionMetrics.MaxCloudRoleInstanceValuesToDiscover;
}
set
{
if (value < 0)
{
throw new ArgumentOutOfRangeException(nameof(value), value, "MaxExceptionCloudRoleInstanceValuesToDiscover value may not be negative.");
}
this.extractorForExceptionMetrics.MaxCloudRoleInstanceValuesToDiscover = value;
}
}
/// <summary>
/// Gets or sets the maximum distinct values for CloudRoleName for Exception telemetry.
/// Values encountered after this limit is hit will be collapsed into a single value DIMENSION_CAPPED.
/// Setting 0 will all values to be replaced with a single value "Other".
/// </summary>
public int MaxExceptionCloudRoleNameValuesToDiscover
{
get
{
return this.extractorForExceptionMetrics.MaxCloudRoleNameValuesToDiscover;
}
set
{
if (value < 0)
{
throw new ArgumentOutOfRangeException(nameof(value), value, "MaxExceptionCloudRoleNameValuesToDiscover value may not be negative.");
}
this.extractorForExceptionMetrics.MaxCloudRoleInstanceValuesToDiscover = value;
}
}
/// <summary>
/// Gets or sets the maximum distinct values for CloudRoleInstance for Request telemetry.
/// Values encountered after this limit is hit will be collapsed into a single value DIMENSION_CAPPED.
@ -369,7 +418,12 @@
{
var dep = item as DependencyTelemetry;
dep.MetricExtractorInfo = ExtractionPipelineInfo(dep.MetricExtractorInfo, extractorInfo);
}
}
else if (item is ExceptionTelemetry)
{
var exp = item as ExceptionTelemetry;
exp.MetricExtractorInfo = ExtractionPipelineInfo(exp.MetricExtractorInfo, extractorInfo);
}
}
private static string ExtractionPipelineInfo(string extractionPipelineInfo, string extractorInfo)

Просмотреть файл

@ -0,0 +1,18 @@
namespace Microsoft.ApplicationInsights.Extensibility.Implementation.Metrics
{
using Microsoft.ApplicationInsights.Channel;
internal class ExceptionMetricIdDimensionExtractor : IDimensionExtractor
{
public int MaxValues { get; set; } = 1;
public string DefaultValue { get; set; } = MetricTerms.Autocollection.Metric.ExceptionCount.Id;
public string Name { get; set; } = MetricDimensionNames.TelemetryContext.Property(MetricTerms.Autocollection.MetricId.Moniker.Key);
public string ExtractDimension(ITelemetry item)
{
return MetricTerms.Autocollection.Metric.ExceptionCount.Id;
}
}
}

Просмотреть файл

@ -0,0 +1,153 @@
namespace Microsoft.ApplicationInsights.Extensibility.Implementation.Metrics
{
using System;
using System.Collections.Generic;
using Microsoft.ApplicationInsights.Channel;
using Microsoft.ApplicationInsights.DataContracts;
using Microsoft.ApplicationInsights.Metrics;
using static System.FormattableString;
/// <summary>
/// An instance of this class is contained within the <see cref="AutocollectedMetricsExtractor"/> telemetry processor.
/// It extracts auto-collected, pre-aggregated (aka. "standard") metrics from ExceptionTelemetry objects which represent
/// invocations of the monitored service.
/// </summary>
internal class ExceptionMetricsExtractor : ISpecificAutocollectedMetricsExtractor
{
/// <summary>
/// The default value for the <see cref="MaxCloudRoleInstanceValuesToDiscover"/> property.
/// </summary>
public const int MaxCloudRoleInstanceValuesToDiscoverDefault = 2;
/// <summary>
/// The default value for the <see cref="MaxCloudRoleNameValuesToDiscover"/> property.
/// </summary>
public const int MaxCloudRoleNameValuesToDiscoverDefault = 2;
private readonly object lockObject = new object();
/// <summary>
/// Extracted metric.
/// </summary>
private Metric exceptionServerMetric = null;
private bool isInitialized = false;
private List<IDimensionExtractor> dimensionExtractors = new List<IDimensionExtractor>();
public ExceptionMetricsExtractor()
{
}
public string ExtractorName { get; } = "Exceptions";
public string ExtractorVersion { get; } = "1.1";
/// <summary>
/// Gets or sets the maximum number of auto-discovered Cloud RoleInstance values.
/// </summary>
public int MaxCloudRoleInstanceValuesToDiscover { get; set; } = MaxCloudRoleInstanceValuesToDiscoverDefault;
/// <summary>
/// Gets or sets the maximum number of auto-discovered Cloud RoleName values.
/// </summary>
public int MaxCloudRoleNameValuesToDiscover { get; set; } = MaxCloudRoleNameValuesToDiscoverDefault;
public void InitializeExtractor(TelemetryClient metricTelemetryClient)
{
if (metricTelemetryClient == null)
{
this.exceptionServerMetric = null;
return;
}
if (!this.isInitialized)
{
lock (this.lockObject)
{
if (!this.isInitialized)
{
this.dimensionExtractors.Add(new ExceptionMetricIdDimensionExtractor());
this.dimensionExtractors.Add(new CloudRoleInstanceDimensionExtractor() { MaxValues = this.MaxCloudRoleInstanceValuesToDiscover });
this.dimensionExtractors.Add(new CloudRoleNameDimensionExtractor() { MaxValues = this.MaxCloudRoleNameValuesToDiscover });
int seriesCountLimit = 1;
int[] valuesPerDimensionLimit = new int[this.dimensionExtractors.Count];
int i = 0;
foreach (var dim in this.dimensionExtractors)
{
int dimLimit = 1;
dimLimit = dim.MaxValues == 0 ? 1 : dim.MaxValues;
seriesCountLimit = seriesCountLimit * (1 + dimLimit);
valuesPerDimensionLimit[i++] = dimLimit;
}
MetricConfiguration config = new MetricConfigurationForMeasurement(
seriesCountLimit,
valuesPerDimensionLimit,
new MetricSeriesConfigurationForMeasurement(restrictToUInt32Values: false));
config.ApplyDimensionCapping = true;
config.DimensionCappedString = MetricTerms.Autocollection.Common.PropertyValues.DimensionCapFallbackValue;
IList<string> dimensionNames = new List<string>(this.dimensionExtractors.Count);
for (i = 0; i < this.dimensionExtractors.Count; i++)
{
dimensionNames.Add(this.dimensionExtractors[i].Name);
}
MetricIdentifier metricIdentifier = new MetricIdentifier(MetricIdentifier.DefaultMetricNamespace,
MetricTerms.Autocollection.Metric.ExceptionCount.Name,
dimensionNames);
this.exceptionServerMetric = metricTelemetryClient.GetMetric(
metricIdentifier: metricIdentifier,
metricConfiguration: config,
aggregationScope: MetricAggregationScope.TelemetryClient);
this.isInitialized = true;
}
}
}
}
public void ExtractMetrics(ITelemetry fromItem, out bool isItemProcessed)
{
ExceptionTelemetry exception = fromItem as ExceptionTelemetry;
if (exception == null)
{
isItemProcessed = false;
return;
}
//// If there is no Metric, then this extractor has not been properly initialized yet:
if (this.exceptionServerMetric == null)
{
//// This should be caught and properly logged by the base class:
throw new InvalidOperationException(Invariant($"Cannot execute {nameof(this.ExtractMetrics)}.")
+ Invariant($" There is no {nameof(this.exceptionServerMetric)}.")
+ Invariant($" Either this metrics extractor has not been initialized, or it has been disposed."));
}
string[] dimValues = new string[this.dimensionExtractors.Count];
for (int i = 0; i < this.dimensionExtractors.Count; i++)
{
var dim = this.dimensionExtractors[i];
if (dim.MaxValues == 0)
{
dimValues[i] = MetricTerms.Autocollection.Common.PropertyValues.Other;
}
else
{
dimValues[i] = dim.ExtractDimension(exception);
if (string.IsNullOrEmpty(dimValues[i]))
{
dimValues[i] = dim.DefaultValue;
}
}
}
CommonHelper.TrackValueHelper(this.exceptionServerMetric, exception.Duration.TotalMilliseconds, dimValues);
isItemProcessed = true;
}
}
}

Просмотреть файл

@ -58,6 +58,12 @@
public const string Name = "Dependency duration";
public const string Id = "dependencies/duration";
}
public static class ExceptionCount
{
public const string Name = "Exceptions";
public const string Id = "exceptions/count";
}
}
public static class Request

Просмотреть файл

@ -41,6 +41,13 @@
</PackageReference>
</ItemGroup>
<ItemGroup>
<Compile Remove="Metrics\Implementation\AutocollectedMetricsExtraction\ExceptionExtractor\ExceptionClientTypeDimensionExtractor.cs" />
<Compile Remove="Metrics\Implementation\AutocollectedMetricsExtraction\ExceptionExtractor\ExceptionIsServerDimensionExtractor.cs" />
<Compile Remove="Metrics\Implementation\AutocollectedMetricsExtraction\ExceptionExtractor\ExceptionSeverityLevelDimensionExtractor.cs" />
<Compile Remove="Metrics\Implementation\AutocollectedMetricsExtraction\ExceptionExtractor\ExceptionTypeDimensionExtractor.cs" />
</ItemGroup>
<ItemGroup>
<!--Build Infrastructure-->
<PackageReference Include="Microsoft.VisualStudioEng.MicroBuild.Core" Version="0.4.1">