|
21 | 21 | from logging import getLogger |
22 | 22 | from math import inf |
23 | 23 | from threading import Lock |
24 | | -from typing import Callable, Generic, List, Optional, Sequence, Type, TypeVar |
| 24 | +from typing import ( |
| 25 | + Callable, |
| 26 | + Generic, |
| 27 | + List, |
| 28 | + Optional, |
| 29 | + Sequence, |
| 30 | + Type, |
| 31 | + TypeVar, |
| 32 | + Union, |
| 33 | +) |
25 | 34 |
|
26 | 35 | from opentelemetry.metrics import ( |
27 | 36 | Asynchronous, |
@@ -463,7 +472,7 @@ def __init__( |
463 | 472 | instrument_aggregation_temporality: AggregationTemporality, |
464 | 473 | start_time_unix_nano: int, |
465 | 474 | reservoir_builder: ExemplarReservoirBuilder, |
466 | | - boundaries: Optional[Sequence[float]] = None, |
| 475 | + boundaries: Optional[Union[Sequence[float], Sequence[int]]] = None, |
467 | 476 | record_min_max: bool = True, |
468 | 477 | ): |
469 | 478 | if boundaries is None: |
@@ -1276,7 +1285,7 @@ def _create_aggregation( |
1276 | 1285 | ) |
1277 | 1286 |
|
1278 | 1287 | if isinstance(instrument, Histogram): |
1279 | | - boundaries: Optional[Sequence[float]] = ( |
| 1288 | + boundaries: Optional[Union[Sequence[float], Sequence[int]]] = ( |
1280 | 1289 | instrument._advisory.get("explicit_bucket_boundaries") |
1281 | 1290 | if instrument._advisory is not None |
1282 | 1291 | else None |
@@ -1361,7 +1370,7 @@ class ExplicitBucketHistogramAggregation(Aggregation): |
1361 | 1370 |
|
1362 | 1371 | def __init__( |
1363 | 1372 | self, |
1364 | | - boundaries: Optional[Sequence[float]] = None, |
| 1373 | + boundaries: Optional[Union[Sequence[float], Sequence[int]]] = None, |
1365 | 1374 | record_min_max: bool = True, |
1366 | 1375 | ) -> None: |
1367 | 1376 | if boundaries is None: |
|
0 commit comments