Skip to content

Commit

Permalink
only track timestamp when activity doesn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
matt-hensley committed Nov 8, 2024
1 parent 440a343 commit d1f090b
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ public override void OnEventWritten(string name, object? payload)
case SqlDataBeforeExecuteCommand:
case SqlMicrosoftBeforeExecuteCommand:
{
this.beginTimestamp.Value = Stopwatch.GetTimestamp();
_ = this.commandFetcher.TryFetch(payload, out var command);
if (command == null)
{
Expand All @@ -91,6 +90,7 @@ public override void OnEventWritten(string name, object? payload)
if (activity == null)
{
// There is no listener or it decided not to sample the current request.
this.beginTimestamp.Value = Stopwatch.GetTimestamp();
return;
}

Expand Down

0 comments on commit d1f090b

Please sign in to comment.