Library name and version
Azure.Monitor.OpenTelemetry.AspNetCore 1.2.0
Query/Question
Hi,
Prologue
We use built-in .NET Core authentication/authorization with multiple schemes for different OpenID providers. Each time I request my API, first call makes requests to all OpenID providers’ “.well-known” endpoints. So far it’s ok. But it creates request and dependency traces for each operation in Application Insights. That traces are totally irrelevant for us and we would like to filter them. I followed your guidelines and did something like this:
builder.Services.AddOpenTelemetry().UseAzureMonitor();
builder.Services.Configure<HttpClientTraceInstrumentationOptions>(options =>
{
options.FilterHttpRequestMessage = req =>
!req.RequestUri.ToString().Contains(".well-known");
});
Problems
- When I do that it still creates “request” telemetry types, even though the condition above is correct. (picture below)
- UseAzureMonitor has it’s own configured Http instrumentation, which is overridden when I do that.
Questions
- How I can fully filter them out? Give me some suggestions please.
- Overriding Http instrumentation seems to me like a violation in the opposite to UseAzureMonitor, as it has its own purpose. I would see that those filtering as additive, instead of replacement. Am I doing something wrong or for know it’s the only way to do that?
- I created ActivityFilteringProcessor with setting up
IsAllDataRequested = false
but it does not totally filter out the traces.
BR
Environment
-
Windows 10
-
Visual Studio 2022 17.10.1
-
.NET SDK:
Version: 8.0.300
Commit: 326f6e68b2
Workload version: 8.0.300-manifests.4e5ea2d8
MSBuild version: 17.10.4+10fbfbf2e -
Runtime Environment:
OS Name: Windows
OS Version: 10.0.19045
OS Platform: Windows
RID: win-x64
Base Path: C:Program Filesdotnetsdk8.0.300