Skip to content

Commit

Permalink
skip recording w/o metric handles
Browse files Browse the repository at this point in the history
  • Loading branch information
matt-hensley committed Nov 8, 2024
1 parent 77661cd commit 440a343
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,11 @@ public override void OnEventWritten(string name, object? payload)

private void RecordDuration(Activity? activity, object? payload, bool hasError = false)
{
if (SqlClientInstrumentation.MetricHandles == 0)
{
return;
}

TagList tags = default(TagList);

if (activity != null && activity.IsAllDataRequested)
Expand Down

0 comments on commit 440a343

Please sign in to comment.