I’m not sure how it was related to the .NET 10 upgrade, but I finally tracked down the issue. We have some custom span code so that we can get detailed Redis query information in APM.
This code would attempt to call StartSpan on the current transaction, but apparently during application startup, if the APM agent was not yet configured and a call to StartSpan was made, we would get the issue I described above. This is despite the fact that setting up the agent is the first thing in our application startup.
I adjusted our method that calls StartSpan to check Elastic.Apm.Agent.IsConfigured and return if is not yet configured and this has resolved the issue.