I use ApmAgent for .net core. I've faced a trouble when call Agent.Tracer.CaptureTransaction.
My use case: query data in one transaction, process it in another transaction. Some code^
Task<int> op1()
{
return Task.FromResult(1);
}
int res = await Agent.Tracer.CaptureTransaction("Op1Transaction", "operation", op1);
Console.WriteLine(Agent.Tracer.CurrentTransaction);
Task<int> op2()
{
return Task.FromResult(2);
}
res = await Agent.Tracer.CaptureTransaction("Op2Transaction", "operation", op2);
Console.WriteLine(Agent.Tracer.CurrentTransaction);
After first call CaptureTransaction I expect that Agent.Tracer.CurrentTransaction equal null, but eventually it contains first transaction Op1Transaction.
What I do wrong?