Hi, after updating one of our .NET 6 services to use Elastic.Apm.Azure.* v1.15.0 (from 1.14.1), we started seeing this in our logs (and do on v1.16.0 as well) about every 30 seconds:
{BackendCommComponentBase (CentralConfigurationFetcher)} WorkLoop Current thread: `ElasticApmCentralConfigurationFetcher' (managed ID: 13)
System.AggregateException: One or more errors occurred. (A task was canceled.)
---> System.Threading.Tasks.TaskCanceledException: A task was canceled.
at System.Threading.Tasks.Task.GetExceptions(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at Elastic.Apm.BackendComm.BackendCommComponentBase.WorkLoop()
at System.Threading.Thread.StartCallback()
--- End of stack trace from previous location ---
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at Elastic.Apm.BackendComm.BackendCommComponentBase.WorkLoop()
I think it's related, but not exactly the same - this is not the same log line as the one from the linked issue. Have you tried turning on central config?
Having this every 30 sec (that's when the agent fetches configs periodically) is clearly not ok. I'll look into this.
Unfortunately the relevant servers in question for this error are controlled by our cloud infrastructure group so I don't have an easy way to try adding a central config, and I'm not sure whether they would do so, though I could check.
When I try to reproduce this via a local Elastic stack running via Docker Compose, I get the error noted in your Github link, rather than the one noted in this thread.
I looked into this more - I wasn't able to reproduce the problem locally, but the log with the exception details you pasted is already useful enough - thanks for that!
The recurring error log is now change to debug (as it was before) - so this WorkLoop related log will only be visible on debug level (which you should only turn on for debugging).
As described in the original issue, when failing to fetch central config due to HttpRequestException (e.g. because central config isn't even enabled) the agent won't print an error. This is an expected scenario, so this will also only show up in debug logs.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.