Skip to content

Commit

Permalink
AggregatorStore: don't double-count drops in doubles
Browse files Browse the repository at this point in the history
As funny as double counting only in doubles is, this seems like an oversight where we inadvertently call `Interlocked.Increment(ref this.DroppedMeasurements);` twice in the non-`emitOverflowAttribute` path. I noticed this digging into a related issue, so thought I'd pop up a PR while in here :)
  • Loading branch information
NickCraver committed Dec 19, 2023
1 parent 63fe0f3 commit 327c5d8
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/OpenTelemetry/Metrics/AggregatorStore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1033,7 +1033,6 @@ private void UpdateDouble(double value, ReadOnlySpan<KeyValuePair<string, object
OpenTelemetrySdkEventSource.Log.MeasurementDropped(this.name, this.metricPointCapHitMessage, MetricPointCapHitFixMessage);
}

Interlocked.Increment(ref this.DroppedMeasurements);
return;
}
}
Expand Down Expand Up @@ -1078,7 +1077,6 @@ private void UpdateDoubleCustomTags(double value, ReadOnlySpan<KeyValuePair<stri
OpenTelemetrySdkEventSource.Log.MeasurementDropped(this.name, this.metricPointCapHitMessage, MetricPointCapHitFixMessage);
}

Interlocked.Increment(ref this.DroppedMeasurements);
return;
}
}
Expand Down

0 comments on commit 327c5d8

Please sign in to comment.