From bfaec2da28042ac681649fcab53b1ccb384afdb4 Mon Sep 17 00:00:00 2001 From: czhang771 <catherinezhang2004@gmail.com> Date: Fri, 30 Aug 2024 10:50:18 -0700 Subject: [PATCH] clean up documentation on exemplar reservoir --- .../sdk/metrics/_internal/exemplar/exemplar_reservoir.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/opentelemetry-sdk/src/opentelemetry/sdk/metrics/_internal/exemplar/exemplar_reservoir.py b/opentelemetry-sdk/src/opentelemetry/sdk/metrics/_internal/exemplar/exemplar_reservoir.py index 310d61a14d..5dcced5069 100644 --- a/opentelemetry-sdk/src/opentelemetry/sdk/metrics/_internal/exemplar/exemplar_reservoir.py +++ b/opentelemetry-sdk/src/opentelemetry/sdk/metrics/_internal/exemplar/exemplar_reservoir.py @@ -97,7 +97,8 @@ def collect(self, point_attributes: Attributes) -> Exemplar | None: """May return an Exemplar and resets the bucket for the next sampling period.""" if not self.__offered: return None - + + # filters out attributes from the measurement that are already included in the metric data point filtered_attributes = ( { k: v @@ -137,10 +138,6 @@ def __init__(self, size: int, **kwargs) -> None: ExemplarBucket() for _ in range(self._size) ] - def maxSize(self) -> int: - """Reservoir maximal size""" - return self._size - def collect(self, point_attributes: Attributes) -> list[Exemplar]: """Returns accumulated Exemplars and also resets the reservoir for the next sampling period @@ -164,7 +161,7 @@ def collect(self, point_attributes: Attributes) -> list[Exemplar]: return [*exemplars] def _reset(self) -> None: - """Reset the reservoir.""" + """Reset the reservoir by resetting any stateful logic after a collection cycle.""" pass