in Elastiflix/dotnet-login-elastic-manual/Controllers/LoginController.cs [24:44]
public ActionResult Get()
{
var transaction = Elastic.Apm.Agent.Tracer.StartTransaction("MyTransaction","Request");
try
{
var user = GenerateRandomUserResponse();
Log.Information("User logged in: {UserName}", user);
return user;
}
catch (Exception e)
{
transaction.CaptureException(e);
throw;
}
finally
{
transaction.End();
}
}