Skip to content

Commit bfaec2d

Browse files
committed
clean up documentation on exemplar reservoir
1 parent eece48d commit bfaec2d

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

opentelemetry-sdk/src/opentelemetry/sdk/metrics/_internal/exemplar/exemplar_reservoir.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@ def collect(self, point_attributes: Attributes) -> Exemplar | None:
9797
"""May return an Exemplar and resets the bucket for the next sampling period."""
9898
if not self.__offered:
9999
return None
100-
100+
101+
# filters out attributes from the measurement that are already included in the metric data point
101102
filtered_attributes = (
102103
{
103104
k: v
@@ -137,10 +138,6 @@ def __init__(self, size: int, **kwargs) -> None:
137138
ExemplarBucket() for _ in range(self._size)
138139
]
139140

140-
def maxSize(self) -> int:
141-
"""Reservoir maximal size"""
142-
return self._size
143-
144141
def collect(self, point_attributes: Attributes) -> list[Exemplar]:
145142
"""Returns accumulated Exemplars and also resets the reservoir for the next
146143
sampling period
@@ -164,7 +161,7 @@ def collect(self, point_attributes: Attributes) -> list[Exemplar]:
164161
return [*exemplars]
165162

166163
def _reset(self) -> None:
167-
"""Reset the reservoir."""
164+
"""Reset the reservoir by resetting any stateful logic after a collection cycle."""
168165
pass
169166

170167

0 commit comments

Comments
 (0)