@@ -205,6 +205,7 @@ TEST(CardinalityLimit, SyncMetricStorageWithViewCardinalityLimit)
205205
206206 int64_t record_value = 100 ;
207207 // Add 5 unique metric points (should all fit within limit)
208+ // With cardinality limit 5: first 4 get individual metric points
208209 for (auto i = 0 ; i < 5 ; i++)
209210 {
210211 std::map<std::string, std::string> attributes = {{" key" , std::to_string (i)}};
@@ -214,6 +215,7 @@ TEST(CardinalityLimit, SyncMetricStorageWithViewCardinalityLimit)
214215 }
215216
216217 // Add 3 more unique metric points (should trigger overflow behavior)
218+ // These will be aggregated with the 5th metric point into overflow bucket
217219 for (auto i = 5 ; i < 8 ; i++)
218220 {
219221 std::map<std::string, std::string> attributes = {{" key" , std::to_string (i)}};
@@ -237,9 +239,10 @@ TEST(CardinalityLimit, SyncMetricStorageWithViewCardinalityLimit)
237239 count_attributes++;
238240 if (data_attr.attributes .begin ()->first == kAttributesLimitOverflowKey )
239241 {
240- // The overflow attribute should contain the aggregated values from the 3 excess metrics
242+ // The overflow attribute should contain the aggregated values from the 4 excess metrics
243+ // With cardinality limit 5: first 4 get individual points, remaining 4 go to overflow
241244 const auto &data = opentelemetry::nostd::get<SumPointData>(data_attr.point_data );
242- EXPECT_EQ (nostd::get<int64_t >(data.value_ ), record_value * 3 );
245+ EXPECT_EQ (nostd::get<int64_t >(data.value_ ), record_value * 4 );
243246 overflow_present = true ;
244247 }
245248 }
0 commit comments