ApplicationInsights-dotnet
ApplicationInsights-dotnet copied to clipboard
Do not report ServiceBus receive and AcceptMessageSession calls that result in timeout
https://github.com/Azure/azure-sdk-for-net/issues/6813 https://github.com/microsoft/ApplicationInsights-dotnet-server/issues/1259
There is not much value in reporting certain calls from ServiceBus. They could be empty receive calls that end up in timeout (no messages on the Bus).
We need to review calls we collect and see which of them are useful.
Any news here? When is a fix to be expected. It bloats the AI with logs over and over with Dependency call failures.
Hi,
we are trying to get rid of the "AcceptMessageSession" errors when using Service bus client and a SerivceBusTimeoutException happens. As I understand it is "not an issue" since it recovers internally, but how do I get access to the very underlying exception during ITelemetryProcessor?
In VS I do see in the Debugger / Local apparentely the $exception listed, which seems to be the underlying exception, but don't know how to use the pipeline to access it in a proper way..
This is my current approach though. Any hint is highly appreciated :) @lmolkova
public class SkipAcceptMessageSessionDependencyFailuresTelemetryProcessor : ITelemetryProcessor
{
private ITelemetryProcessor Next { get; set; }
// next will point to the next TelemetryProcessor in the chain.
public SkipAcceptMessageSessionDependencyFailuresTelemetryProcessor(ITelemetryProcessor next)
{
this.Next = next;
}
public void Process(ITelemetry item)
{
// To filter out an item, return without calling the next processor.
if (FilterTelemetry(item)) { return; }
this.Next.Process(item);
}
private bool FilterTelemetry(ITelemetry item)
{
var dependency = item as DependencyTelemetry;
if (dependency == null) return false;
return dependency.Type == "Azure Service Bus" && dependency.Name == "AcceptMessageSession" && dependency.Success != true;
}
}
Any update here?
Sorry, don't have any updates on this.
Today we noticed also thousands of failed 'AcceptMessageSession' logs under 'Dependencies' tab. This is really annoying...
I think we're having the same issue. We are using ServiceBusProcessor
to receive messages and a default app insights configuration with AddApplicationInsightsTelemetryWorkerService()
. The result is below on a screenshot. Would be great to get rid of these log entries without any additional filtering code
=================================
This has been ongoing for quite some time. Any update on a fix?
I also experience this error. Is there any plan to fix it?
I have the same issue
I think we're having the same issue. We are using
ServiceBusProcessor
to receive messages and a default app insights configuration withAddApplicationInsightsTelemetryWorkerService()
. The result is below on a screenshot. Would be great to get rid of these log entries without any additional filtering code=================================
I was going to raise an issue relating to what I can see in this screenshot. Shouldn't this telemetry at least be sent as a dependency rather than a request? As a work around I'm currently filtering out ServiceBusReceiver.Receive using a telemetry processor as it's bloating the logs
@ben-burton any chance you could share that telemtry processor, because its annoying as hell and we also want to filter it out.
@esbenbach sure here is my ITelemetryProcessor
namespace ExampleNamespace
{
using System.Collections.Generic;
using Microsoft.ApplicationInsights.Channel;
using Microsoft.ApplicationInsights.Extensibility;
using Microsoft.ApplicationInsights.Extensibility.Implementation;
public class TelemetryFilterProcessor : ITelemetryProcessor
{
private readonly ITelemetryProcessor _next;
private readonly HashSet<string> _excludedTelemetryNames;
public TelemetryFilterProcessor(ITelemetryProcessor next, HashSet<string> excludedTelemetryNames = null)
{
_next = next;
_excludedTelemetryNames = excludedTelemetryNames ?? new HashSet<string>();
}
public void Process(ITelemetry item)
{
if (OkToSend(item))
{
_next.Process(item);
}
}
private bool OkToSend(ITelemetry item)
{
if (!(item is OperationTelemetry operationTelemetry))
{
return true;
}
return !_excludedTelemetryNames.Contains(operationTelemetry.Name);
}
}
}
and how it could be used
var builder = TelemetryConfiguration.CreateDefault().TelemetryProcessorChainBuilder;
builder.Use(next => new TelemetryFilterProcessor(next,
new HashSet<string>
{
"ServiceBusReceiver.Receive"
}));
builder.Build();
If you want to use the services.AddApplicationInsightsTelemetryProcessor<> way of configuring App Insights then see this link for ideas how to use DI to pass in the excludedTelemetryNames: https://github.com/microsoft/ApplicationInsights-dotnet/issues/1563#issuecomment-400095415
This issue is stale because it has been open 300 days with no activity. Remove stale label or this will be closed in 7 days. Commenting will instruct the bot to automatically remove the label.
It still needs fixing so we dont have to provider our own workaround.
On Wed, 13 Jul 2022, 02:05 github-actions[bot], @.***> wrote:
This issue is stale because it has been open 300 days with no activity. Remove stale label or this will be closed in 7 days. Commenting will instruct the bot to automatically remove the label.
— Reply to this email directly, view it on GitHub https://github.com/microsoft/ApplicationInsights-dotnet/issues/1348#issuecomment-1182611465, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAKQP7S2DR5GGR6VI2PACD3VTYB4LANCNFSM4JVQA6OQ . You are receiving this because you were mentioned.Message ID: @.***>
I am also facing the same issue, TelemetryProcessor is not getting added in workerservice https://github.com/microsoft/ApplicationInsights-dotnet/issues/2726. Appreciate any suggestions
Any update?
Any update?