You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When an APM Agent sends an event that exceeds the max_event_size parameter set on the APM Server (defaults to 307200 bytes), the APM Server will return an error event exceeded the allowed size.
The exception will be logged and a new Error object will be created (also of huge size, because of ApmServerResponseContent), which will be added to the queue to be sent to the APM Server.
The delivery of this Error to the APM Server will again end with event exceeded the allowed size error, as a result of which a new Error object will again be created and added to the queue. And so on and so on, over and over again. This will go on indefinitely.
Error event exceeded the allowed size will appear in the log every 10 seconds
usingSystem.Diagnostics;usingMicrosoft.AspNetCore.Mvc;namespaceWebApiExample.Controllers;[ApiController][Route("[controller]")]publicclassWeatherForecastController:ControllerBase{privatestaticreadonlystring[]Summaries=["Freezing","Bracing","Chilly","Cool","Mild","Warm","Balmy","Hot","Sweltering","Scorching"];[HttpGet(Name="GetWeatherForecast")]publicIEnumerable<WeatherForecast>Get(){// We do this to exceed the limit set in max_event_size (307200 bytes)usingvaractivity=newActivitySource("test").StartActivity();for(vari=1;i<=32;i++){activity?.AddTag("key"+i,newstring('1',10000));}returnEnumerable.Range(1,5).Select(index =>newWeatherForecast{Date=DateOnly.FromDateTime(DateTime.Now.AddDays(index)),TemperatureC=Random.Shared.Next(-20,55),Summary=Summaries[Random.Shared.Next(Summaries.Length)]}).ToArray();}}
Expected behavior
The APM Agent will log an exception raised when delivering events to the APM Server, but will not create a new Error that will cause the same delivery problems.
OR maybe you shouldn't log content of serialized events. After all, there may be hundreds of kilobytes or even megabytes there - it's very expensive.
Actual behavior
APM Agent unsuccessfully tries to send the event exceeded the allowed size error information over and over again.
The text was updated successfully, but these errors were encountered:
APM Agent version
1.29.0
Environment
Operating system and version: Linux, Windows
.NET Framework/Core name and version: .NET 8
Application Target Framework(s): .NET 8
Describe the bug
When an APM Agent sends an event that exceeds the
max_event_size
parameter set on the APM Server (defaults to 307200 bytes), the APM Server will return an errorevent exceeded the allowed size
.The exception will be logged and a new
Error
object will be created (also of huge size, because ofApmServerResponseContent
), which will be added to the queue to be sent to the APM Server.apm-agent-dotnet/src/Elastic.Apm/Report/PayloadSenderV2.cs
Lines 421 to 431 in 31cb8cb
The delivery of this
Error
to the APM Server will again end withevent exceeded the allowed size
error, as a result of which a newError
object will again be created and added to the queue. And so on and so on, over and over again. This will go on indefinitely.To Reproduce
Steps to reproduce the behavior:
WebApiExample
appsettings.json
add required ElasticApm configuration for your APM Server instance (ServerUrl
,SecretToken
, etc. )WeatherForecastController
implementation (see code snippet below)event exceeded the allowed size
will appear in the log every 10 secondsExpected behavior
The APM Agent will log an exception raised when delivering events to the APM Server, but will not create a new Error that will cause the same delivery problems.
OR maybe you shouldn't log content of serialized events. After all, there may be hundreds of kilobytes or even megabytes there - it's very expensive.
Actual behavior
APM Agent unsuccessfully tries to send the
event exceeded the allowed size
error information over and over again.The text was updated successfully, but these errors were encountered: