Hi,
when I am using APM agent with Dapper I think the execution time for sql query is calculated incorrectly.
APM Server version: 7.13.3
APM Agent language and version: dotnet core 1.7.1
Description of the problem including expected versus actual behavior. Please include screenshots (if relevant): Executing sql query does not contain time when reading from stream.
Steps to reproduce:
- Execute query which contains multiple results sets.
- Query is executed on dapper which db connection is based on standards .net core libraries
- SQL execution query time does not include time when reading the stream. It only takes into account parsing and submitting the query (I think).
Sample SQL Query placed in apm-agent-dotnet/ValuesController.cs at master · elastic/apm-agent-dotnet · GitHub
[HttpGet("poc")]
public async Task<ActionResult<string>> Poc()
{
using var dbConnection = new SqlConnection("<connection_string>");
using var multi = await dbConnection.QueryMultipleAsync(@"
WAITFOR DELAY '00:00:05'
SELECT 1
WAITFOR DELAY '00:00:05'
SELECT 2
WAITFOR DELAY '00:00:05'
SELECT 3");
var one = await multi.ReadFirstAsync<int>();
var two = await multi.ReadFirstAsync<int>();
var three = await multi.ReadFirstAsync<int>();
return $"POC Hello World! {one}, {two}, {three}";
}
Please see below span.
Project references:
<PackageReference Include="Dapper" Version="2.0.35" />
<PackageReference Include="Microsoft.Data.SqlClient" Version="3.0.0" />