Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove MetricPointCaptHitMessage
  • Loading branch information
xiang17 committed Oct 23, 2024
commit 9e4fe9bf81893201d18935a8ef13f21534ecd731
12 changes: 0 additions & 12 deletions src/OpenTelemetry/Metrics/AggregatorStore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ internal sealed class AggregatorStore
internal long DroppedMeasurements = 0;

private const ExemplarFilterType DefaultExemplarFilter = ExemplarFilterType.AlwaysOff;
private static readonly string MetricPointCapHitFixMessage = "The overflow attribute is set because the cardinality limit is reached. You could modify instrumentation to reduce the number of unique key/value pair combinations. Or use Views to drop unwanted tags. Or use MeterProviderBuilder.SetMaxMetricPointsPerMetricStream to set higher limit.";
private static readonly Comparison<KeyValuePair<string, object?>> DimensionComparisonDelegate = (x, y) => x.Key.CompareTo(y.Key);

private readonly Lock lockZeroTags = new();
Expand All @@ -41,7 +40,6 @@ internal sealed class AggregatorStore
new();

private readonly string name;
private readonly string metricPointCapHitMessage;
private readonly MetricPoint[] metricPoints;
private readonly int[] currentMetricPointBatch;
private readonly AggregationType aggType;
Expand All @@ -55,7 +53,6 @@ internal sealed class AggregatorStore

private int metricPointIndex = 0;
private int batchSize = 0;
private int metricCapHitMessageLogged;
private bool zeroTagMetricPointInitialized;
private bool overflowTagMetricPointInitialized;

Expand All @@ -75,7 +72,6 @@ internal AggregatorStore(
// Previously, these were included within the original cardinalityLimit, but now they are explicitly added to enhance clarity.
this.NumberOfMetricPoints = cardinalityLimit + 2;

this.metricPointCapHitMessage = $"Maximum MetricPoints limit reached for this Metric stream. Configured limit: {cardinalityLimit}";
this.metricPoints = new MetricPoint[this.NumberOfMetricPoints];
this.currentMetricPointBatch = new int[this.NumberOfMetricPoints];
this.aggType = aggType;
Expand Down Expand Up @@ -989,10 +985,6 @@ private void UpdateLongMetricPoint(int metricPointIndex, long value, ReadOnlySpa
Interlocked.Increment(ref this.DroppedMeasurements);
this.InitializeOverflowTagPointIfNotInitialized();
this.metricPoints[1].Update(value);
if (Interlocked.CompareExchange(ref this.metricCapHitMessageLogged, 1, 0) == 0)
{
OpenTelemetrySdkEventSource.Log.MeasurementDropped(this.name, this.metricPointCapHitMessage, MetricPointCapHitFixMessage);
}

return;
}
Expand Down Expand Up @@ -1040,10 +1032,6 @@ private void UpdateDoubleMetricPoint(int metricPointIndex, double value, ReadOnl
Interlocked.Increment(ref this.DroppedMeasurements);
this.InitializeOverflowTagPointIfNotInitialized();
this.metricPoints[1].Update(value);
if (Interlocked.CompareExchange(ref this.metricCapHitMessageLogged, 1, 0) == 0)
{
OpenTelemetrySdkEventSource.Log.MeasurementDropped(this.name, this.metricPointCapHitMessage, MetricPointCapHitFixMessage);
}

return;
}
Expand Down