Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions BASE/src/Microsoft.ApplicationInsights/TelemetryClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -445,8 +445,6 @@
{
histogram.Record(telemetry.Value);
}

this.Track(telemetry);
}

/// <summary>
Expand All @@ -461,7 +459,7 @@
{
if (exception == null)
{
exception = new Exception(Utils.PopulateRequiredStringValue(null, "message", typeof(ExceptionTelemetry).FullName));

Check warning on line 462 in BASE/src/Microsoft.ApplicationInsights/TelemetryClient.cs

View workflow job for this annotation

GitHub Actions / build-test-SHIM (ubuntu-latest, net472)

Exception type System.Exception is not sufficiently specific (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2201)

Check warning on line 462 in BASE/src/Microsoft.ApplicationInsights/TelemetryClient.cs

View workflow job for this annotation

GitHub Actions / build-test-SHIM (ubuntu-latest, net480)

Exception type System.Exception is not sufficiently specific (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2201)

Check warning on line 462 in BASE/src/Microsoft.ApplicationInsights/TelemetryClient.cs

View workflow job for this annotation

GitHub Actions / build-test-SHIM (ubuntu-latest, net481)

Exception type System.Exception is not sufficiently specific (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2201)

Check warning on line 462 in BASE/src/Microsoft.ApplicationInsights/TelemetryClient.cs

View workflow job for this annotation

GitHub Actions / build-test-SHIM (ubuntu-latest, net462)

Exception type System.Exception is not sufficiently specific (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2201)

Check warning on line 462 in BASE/src/Microsoft.ApplicationInsights/TelemetryClient.cs

View workflow job for this annotation

GitHub Actions / build-test-SHIM (ubuntu-latest, net9.0)

Exception type System.Exception is not sufficiently specific (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2201)

Check warning on line 462 in BASE/src/Microsoft.ApplicationInsights/TelemetryClient.cs

View workflow job for this annotation

GitHub Actions / build-test-SHIM (ubuntu-latest, net10.0)

Exception type System.Exception is not sufficiently specific (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2201)

Check warning on line 462 in BASE/src/Microsoft.ApplicationInsights/TelemetryClient.cs

View workflow job for this annotation

GitHub Actions / build-test-SHIM (ubuntu-latest, net8.0)

Exception type System.Exception is not sufficiently specific (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2201)
}

var state = new DictionaryLogState(this.Context, properties, exception.Message);
Expand All @@ -480,7 +478,7 @@
// TODO investigate how problem id, custom message, etc should appear in portal
if (telemetry == null)
{
var exception = new Exception(Utils.PopulateRequiredStringValue(null, "message", typeof(ExceptionTelemetry).FullName));

Check warning on line 481 in BASE/src/Microsoft.ApplicationInsights/TelemetryClient.cs

View workflow job for this annotation

GitHub Actions / build-test-SHIM (ubuntu-latest, net472)

Exception type System.Exception is not sufficiently specific (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2201)

Check warning on line 481 in BASE/src/Microsoft.ApplicationInsights/TelemetryClient.cs

View workflow job for this annotation

GitHub Actions / build-test-SHIM (ubuntu-latest, net480)

Exception type System.Exception is not sufficiently specific (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2201)

Check warning on line 481 in BASE/src/Microsoft.ApplicationInsights/TelemetryClient.cs

View workflow job for this annotation

GitHub Actions / build-test-SHIM (ubuntu-latest, net481)

Exception type System.Exception is not sufficiently specific (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2201)

Check warning on line 481 in BASE/src/Microsoft.ApplicationInsights/TelemetryClient.cs

View workflow job for this annotation

GitHub Actions / build-test-SHIM (ubuntu-latest, net462)

Exception type System.Exception is not sufficiently specific (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2201)

Check warning on line 481 in BASE/src/Microsoft.ApplicationInsights/TelemetryClient.cs

View workflow job for this annotation

GitHub Actions / build-test-SHIM (ubuntu-latest, net9.0)

Exception type System.Exception is not sufficiently specific (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2201)

Check warning on line 481 in BASE/src/Microsoft.ApplicationInsights/TelemetryClient.cs

View workflow job for this annotation

GitHub Actions / build-test-SHIM (ubuntu-latest, net10.0)

Exception type System.Exception is not sufficiently specific (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2201)

Check warning on line 481 in BASE/src/Microsoft.ApplicationInsights/TelemetryClient.cs

View workflow job for this annotation

GitHub Actions / build-test-SHIM (ubuntu-latest, net8.0)

Exception type System.Exception is not sufficiently specific (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2201)
telemetry = new ExceptionTelemetry(exception);
}

Expand Down Expand Up @@ -711,7 +709,7 @@
break;

default:
CoreEventSource.Log.UnsupportedTelemetryType(telemetry?.GetType()?.Name ?? "null");

Check warning on line 712 in BASE/src/Microsoft.ApplicationInsights/TelemetryClient.cs

View workflow job for this annotation

GitHub Actions / build-test-SHIM (ubuntu-latest, net472)

'telemetry' is never 'null'. Remove or refactor the condition(s) to avoid dead code. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1508)

Check warning on line 712 in BASE/src/Microsoft.ApplicationInsights/TelemetryClient.cs

View workflow job for this annotation

GitHub Actions / build-test-SHIM (ubuntu-latest, net480)

'telemetry' is never 'null'. Remove or refactor the condition(s) to avoid dead code. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1508)

Check warning on line 712 in BASE/src/Microsoft.ApplicationInsights/TelemetryClient.cs

View workflow job for this annotation

GitHub Actions / build-test-SHIM (ubuntu-latest, net481)

'telemetry' is never 'null'. Remove or refactor the condition(s) to avoid dead code. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1508)

Check warning on line 712 in BASE/src/Microsoft.ApplicationInsights/TelemetryClient.cs

View workflow job for this annotation

GitHub Actions / build-test-SHIM (ubuntu-latest, net462)

'telemetry' is never 'null'. Remove or refactor the condition(s) to avoid dead code. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1508)

Check warning on line 712 in BASE/src/Microsoft.ApplicationInsights/TelemetryClient.cs

View workflow job for this annotation

GitHub Actions / build-test-SHIM (ubuntu-latest, net9.0)

'telemetry' is never 'null'. Remove or refactor the condition(s) to avoid dead code. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1508)

Check warning on line 712 in BASE/src/Microsoft.ApplicationInsights/TelemetryClient.cs

View workflow job for this annotation

GitHub Actions / build-test-SHIM (ubuntu-latest, net10.0)

'telemetry' is never 'null'. Remove or refactor the condition(s) to avoid dead code. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1508)

Check warning on line 712 in BASE/src/Microsoft.ApplicationInsights/TelemetryClient.cs

View workflow job for this annotation

GitHub Actions / build-test-SHIM (ubuntu-latest, net8.0)

'telemetry' is never 'null'. Remove or refactor the condition(s) to avoid dead code. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1508)
break;
}
}
Expand Down Expand Up @@ -1237,7 +1235,7 @@
else
{
// Fallback: create a generic exception with the message
rootException = new Exception(telemetry.Message ?? "<no message>");

Check warning on line 1238 in BASE/src/Microsoft.ApplicationInsights/TelemetryClient.cs

View workflow job for this annotation

GitHub Actions / build-test-SHIM (ubuntu-latest, net472)

Exception type System.Exception is not sufficiently specific (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2201)

Check warning on line 1238 in BASE/src/Microsoft.ApplicationInsights/TelemetryClient.cs

View workflow job for this annotation

GitHub Actions / build-test-SHIM (ubuntu-latest, net480)

Exception type System.Exception is not sufficiently specific (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2201)

Check warning on line 1238 in BASE/src/Microsoft.ApplicationInsights/TelemetryClient.cs

View workflow job for this annotation

GitHub Actions / build-test-SHIM (ubuntu-latest, net481)

Exception type System.Exception is not sufficiently specific (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2201)

Check warning on line 1238 in BASE/src/Microsoft.ApplicationInsights/TelemetryClient.cs

View workflow job for this annotation

GitHub Actions / build-test-SHIM (ubuntu-latest, net462)

Exception type System.Exception is not sufficiently specific (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2201)

Check warning on line 1238 in BASE/src/Microsoft.ApplicationInsights/TelemetryClient.cs

View workflow job for this annotation

GitHub Actions / build-test-SHIM (ubuntu-latest, net9.0)

Exception type System.Exception is not sufficiently specific (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2201)

Check warning on line 1238 in BASE/src/Microsoft.ApplicationInsights/TelemetryClient.cs

View workflow job for this annotation

GitHub Actions / build-test-SHIM (ubuntu-latest, net10.0)

Exception type System.Exception is not sufficiently specific (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2201)

Check warning on line 1238 in BASE/src/Microsoft.ApplicationInsights/TelemetryClient.cs

View workflow job for this annotation

GitHub Actions / build-test-SHIM (ubuntu-latest, net8.0)

Exception type System.Exception is not sufficiently specific (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2201)
}

// Enrich the exception with metadata
Expand All @@ -1255,7 +1253,7 @@
{
if (exceptionDetailsList == null || exceptionDetailsList.Count == 0)
{
return new Exception("<no exception details>");

Check warning on line 1256 in BASE/src/Microsoft.ApplicationInsights/TelemetryClient.cs

View workflow job for this annotation

GitHub Actions / build-test-SHIM (ubuntu-latest, net472)

Exception type System.Exception is not sufficiently specific (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2201)

Check warning on line 1256 in BASE/src/Microsoft.ApplicationInsights/TelemetryClient.cs

View workflow job for this annotation

GitHub Actions / build-test-SHIM (ubuntu-latest, net480)

Exception type System.Exception is not sufficiently specific (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2201)

Check warning on line 1256 in BASE/src/Microsoft.ApplicationInsights/TelemetryClient.cs

View workflow job for this annotation

GitHub Actions / build-test-SHIM (ubuntu-latest, net481)

Exception type System.Exception is not sufficiently specific (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2201)

Check warning on line 1256 in BASE/src/Microsoft.ApplicationInsights/TelemetryClient.cs

View workflow job for this annotation

GitHub Actions / build-test-SHIM (ubuntu-latest, net462)

Exception type System.Exception is not sufficiently specific (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2201)

Check warning on line 1256 in BASE/src/Microsoft.ApplicationInsights/TelemetryClient.cs

View workflow job for this annotation

GitHub Actions / build-test-SHIM (ubuntu-latest, net9.0)

Exception type System.Exception is not sufficiently specific (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2201)

Check warning on line 1256 in BASE/src/Microsoft.ApplicationInsights/TelemetryClient.cs

View workflow job for this annotation

GitHub Actions / build-test-SHIM (ubuntu-latest, net10.0)

Exception type System.Exception is not sufficiently specific (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2201)

Check warning on line 1256 in BASE/src/Microsoft.ApplicationInsights/TelemetryClient.cs

View workflow job for this annotation

GitHub Actions / build-test-SHIM (ubuntu-latest, net8.0)

Exception type System.Exception is not sufficiently specific (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2201)
}

// Process from innermost (index 0) to outermost (last index)
Expand All @@ -1274,11 +1272,11 @@

if (innerException != null)
{
currentException = new Exception($"[{typeName}] {message}", innerException);

Check warning on line 1275 in BASE/src/Microsoft.ApplicationInsights/TelemetryClient.cs

View workflow job for this annotation

GitHub Actions / build-test-SHIM (ubuntu-latest, net472)

Exception type System.Exception is not sufficiently specific (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2201)

Check warning on line 1275 in BASE/src/Microsoft.ApplicationInsights/TelemetryClient.cs

View workflow job for this annotation

GitHub Actions / build-test-SHIM (ubuntu-latest, net480)

Exception type System.Exception is not sufficiently specific (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2201)

Check warning on line 1275 in BASE/src/Microsoft.ApplicationInsights/TelemetryClient.cs

View workflow job for this annotation

GitHub Actions / build-test-SHIM (ubuntu-latest, net481)

Exception type System.Exception is not sufficiently specific (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2201)

Check warning on line 1275 in BASE/src/Microsoft.ApplicationInsights/TelemetryClient.cs

View workflow job for this annotation

GitHub Actions / build-test-SHIM (ubuntu-latest, net462)

Exception type System.Exception is not sufficiently specific (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2201)

Check warning on line 1275 in BASE/src/Microsoft.ApplicationInsights/TelemetryClient.cs

View workflow job for this annotation

GitHub Actions / build-test-SHIM (ubuntu-latest, net9.0)

Exception type System.Exception is not sufficiently specific (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2201)

Check warning on line 1275 in BASE/src/Microsoft.ApplicationInsights/TelemetryClient.cs

View workflow job for this annotation

GitHub Actions / build-test-SHIM (ubuntu-latest, net10.0)

Exception type System.Exception is not sufficiently specific (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2201)

Check warning on line 1275 in BASE/src/Microsoft.ApplicationInsights/TelemetryClient.cs

View workflow job for this annotation

GitHub Actions / build-test-SHIM (ubuntu-latest, net8.0)

Exception type System.Exception is not sufficiently specific (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2201)
}
else
{
currentException = new Exception($"[{typeName}] {message}");

Check warning on line 1279 in BASE/src/Microsoft.ApplicationInsights/TelemetryClient.cs

View workflow job for this annotation

GitHub Actions / build-test-SHIM (ubuntu-latest, net472)

Exception type System.Exception is not sufficiently specific (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2201)

Check warning on line 1279 in BASE/src/Microsoft.ApplicationInsights/TelemetryClient.cs

View workflow job for this annotation

GitHub Actions / build-test-SHIM (ubuntu-latest, net480)

Exception type System.Exception is not sufficiently specific (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2201)

Check warning on line 1279 in BASE/src/Microsoft.ApplicationInsights/TelemetryClient.cs

View workflow job for this annotation

GitHub Actions / build-test-SHIM (ubuntu-latest, net481)

Exception type System.Exception is not sufficiently specific (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2201)

Check warning on line 1279 in BASE/src/Microsoft.ApplicationInsights/TelemetryClient.cs

View workflow job for this annotation

GitHub Actions / build-test-SHIM (ubuntu-latest, net462)

Exception type System.Exception is not sufficiently specific (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2201)

Check warning on line 1279 in BASE/src/Microsoft.ApplicationInsights/TelemetryClient.cs

View workflow job for this annotation

GitHub Actions / build-test-SHIM (ubuntu-latest, net9.0)

Exception type System.Exception is not sufficiently specific (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2201)

Check warning on line 1279 in BASE/src/Microsoft.ApplicationInsights/TelemetryClient.cs

View workflow job for this annotation

GitHub Actions / build-test-SHIM (ubuntu-latest, net10.0)

Exception type System.Exception is not sufficiently specific (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2201)

Check warning on line 1279 in BASE/src/Microsoft.ApplicationInsights/TelemetryClient.cs

View workflow job for this annotation

GitHub Actions / build-test-SHIM (ubuntu-latest, net8.0)

Exception type System.Exception is not sufficiently specific (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2201)
}

// Set the current exception as the inner for the next iteration
Expand Down
Loading