|
14 | 14 |
|
15 | 15 | from abc import ABC, abstractmethod
|
16 | 16 | from random import randrange
|
17 |
| -from typing import Any, Callable, Optional, Sequence, Union |
| 17 | +from typing import Any, Callable, Dict, List, Optional, Sequence, Union |
18 | 18 |
|
19 | 19 | from opentelemetry import trace
|
20 | 20 | from opentelemetry.context import Context
|
@@ -55,7 +55,7 @@ def offer(
|
55 | 55 | raise NotImplementedError("ExemplarReservoir.offer is not implemented")
|
56 | 56 |
|
57 | 57 | @abstractmethod
|
58 |
| - def collect(self, point_attributes: Attributes) -> list[Exemplar]: |
| 58 | + def collect(self, point_attributes: Attributes) -> List[Exemplar]: |
59 | 59 | """Returns accumulated Exemplars and also resets the reservoir for the next
|
60 | 60 | sampling period
|
61 | 61 |
|
@@ -155,11 +155,11 @@ class FixedSizeExemplarReservoirABC(ExemplarReservoir):
|
155 | 155 | def __init__(self, size: int, **kwargs) -> None:
|
156 | 156 | super().__init__(**kwargs)
|
157 | 157 | self._size: int = size
|
158 |
| - self._reservoir_storage: list[ExemplarBucket] = [ |
| 158 | + self._reservoir_storage: List[ExemplarBucket] = [ |
159 | 159 | ExemplarBucket() for _ in range(self._size)
|
160 | 160 | ]
|
161 | 161 |
|
162 |
| - def collect(self, point_attributes: Attributes) -> list[Exemplar]: |
| 162 | + def collect(self, point_attributes: Attributes) -> List[Exemplar]: |
163 | 163 | """Returns accumulated Exemplars and also resets the reservoir for the next
|
164 | 164 | sampling period
|
165 | 165 |
|
@@ -313,7 +313,7 @@ def _find_bucket_index(
|
313 | 313 | return len(self._boundaries)
|
314 | 314 |
|
315 | 315 |
|
316 |
| -ExemplarReservoirBuilder = Callable[[dict[str, Any]], ExemplarReservoir] |
| 316 | +ExemplarReservoirBuilder = Callable[[Dict[str, Any]], ExemplarReservoir] |
317 | 317 | ExemplarReservoirBuilder.__doc__ = """ExemplarReservoir builder.
|
318 | 318 |
|
319 | 319 | It may receive the Aggregation parameters it is bounded to; e.g.
|
|
0 commit comments