We recently had an issue where Insights led us to believe one of our API services was performing very slowly.
The web service is built in .NET with the latest agent installed.
We were trying to calculate the internal duration by excluding external calls using (duration-externalDuration).
The total duration of the transactions was consistently around 6 seconds and the reported external duration around 2 seconds. On investigation we could see that actually the external duration was actually 4 seconds, this was based on our internal logs, recording a DateTime whenever a request is set and received.
My question is, how does the agent determine when an external request has been made? Are there certain coding patterns where the agent may not report accurately?
Not all of our API services have this issue, but they are not obviously implemented differently.
Any ideas appreciated.