Closed cosmin19 closed 3 months ago
The version of the Elastic.Apm nuget package used: 1.28.0
Elastic.Apm
1.28.0
Operating system and version: Windows 11
Windows 11
.NET Framework/Core name and version (e.g. .NET 4.6.2, NET Core 3.1.100) : .NET 8
.NET 8
Application Target Framework(s) (e.g. net462, netcoreapp3.1): net8.0
net8.0
When using AddFilter on APM Agent, the Agent stops sending data to the server, stops creating transactions for HTTP requests, stops doing anything.
AddFilter
ASP.NET Core Web API
Program.cs
builder.Services.AddAllElasticApm(); Agent.AddFilter((ISpan span) => { return span; });
var currentTransaction = Agent.Tracer.CurrentTransaction;
currentTransaction
null
*Same behaviour for Agent.AddFilter((ITransaction transaction) => { ... });
Agent.AddFilter((ITransaction transaction) => { ... });
The Agent should create transactions and spans and send them to APM server.
The Agent doesn't create transactions and spans
Thanks for reporting this one @cosmin19 and appologies for taking a bit to get to work on a fix.
I opened https://github.com/elastic/apm-agent-dotnet/pull/2418 to address this.
APM Agent version
The version of the
Elastic.Apm
nuget package used:1.28.0
Environment
Operating system and version:
Windows 11
.NET Framework/Core name and version (e.g. .NET 4.6.2, NET Core 3.1.100) :
.NET 8
Application Target Framework(s) (e.g. net462, netcoreapp3.1):
net8.0
Describe the bug
When using
AddFilter
on APM Agent, the Agent stops sending data to the server, stops creating transactions for HTTP requests, stops doing anything.To Reproduce
ASP.NET Core Web API
project, targeting .NET 8Program.cs
and addcurrentTransaction
variable. Observe that isnull
Program.cs
class and removeAddFilter
code*Same behaviour for
Agent.AddFilter((ITransaction transaction) => { ... });
Expected behavior
The Agent should create transactions and spans and send them to APM server.
Actual behavior
The Agent doesn't create transactions and spans