log to indicated Authentication Policy caught the response from ingestion (#2319)
This commit is contained in:
Родитель
7c6589e2c5
Коммит
dfa51220a5
|
@ -565,6 +565,12 @@
|
|||
this.WriteEvent(77, exception ?? string.Empty, this.ApplicationName);
|
||||
}
|
||||
|
||||
[Event(78, Message = "AuthenticatedTransmissionError. Received a failed ingestion response. TransmissionId: {0}. Status Code: {1}. Status Description: {2}", Level = EventLevel.Warning)]
|
||||
public void AuthenticationPolicyCaughtFailedIngestion(string transmissionId, string statusCode, string statusDescription, string appDomainName = "Incorrect")
|
||||
{
|
||||
this.WriteEvent(78, transmissionId ?? string.Empty, statusCode ?? string.Empty, statusDescription ?? string.Empty, this.ApplicationName);
|
||||
}
|
||||
|
||||
private static string GetApplicationName()
|
||||
{
|
||||
//// We want to add application name to all events BUT
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
namespace Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel.Implementation.TransmissionPolicy
|
||||
{
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using Microsoft.ApplicationInsights.Channel.Implementation;
|
||||
|
@ -65,6 +66,10 @@
|
|||
{
|
||||
case ResponseStatusCodes.Unauthorized:
|
||||
case ResponseStatusCodes.Forbidden:
|
||||
TelemetryChannelEventSource.Log.AuthenticationPolicyCaughtFailedIngestion(
|
||||
transmissionId: e.Transmission.Id,
|
||||
statusCode: e.Response.StatusCode.ToString(CultureInfo.InvariantCulture),
|
||||
statusDescription: e.Response.StatusDescription);
|
||||
this.ApplyThrottlePolicy(e);
|
||||
break;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче