How to Instrument Custom Methods in .NET with Elastic APM (Like New Relic XML Configuration)

Hi everyone,

We are migrating to Elastic APM and trying to achieve custom method instrumentation for our .NET application. In New Relic, we used XML configuration to declare specific methods for instrumentation (as described (https://docs.newrelic.com/docs/apm/agents/net-agent/custom-instrumentation/add-detail-transactions-xml-net/)).

We followed the Elastic APM .NET agent auto-instrumentation guide (https://www.elastic.co/guide/en/apm/agent/dotnet/current/setup-auto-instrumentation.html)), but the results only show HTTP requests, database queries, and Redis calls — our custom code methods don’t appear in the traces.

Is there a way to manually configure or declare custom methods for instrumentation that are similar to New Relic’s XML approach? Or is there an alternative solution to achieve this with Elastic APM without changing my existing code?

We’d really appreciate any guidance or best practices to get this working!

Thanks in advance!