Skip to content

Commit

Permalink
Permit also a sequence of ints as boundaries
Browse files Browse the repository at this point in the history
  • Loading branch information
xrmx committed Jan 15, 2025
1 parent 3284c00 commit c148618
Showing 1 changed file with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,16 @@
from logging import getLogger
from math import inf
from threading import Lock
from typing import Callable, Generic, List, Optional, Sequence, Type, TypeVar
from typing import (
Callable,
Generic,
List,
Optional,
Sequence,
Type,
TypeVar,
Union,
)

from opentelemetry.metrics import (
Asynchronous,
Expand Down Expand Up @@ -463,7 +472,7 @@ def __init__(
instrument_aggregation_temporality: AggregationTemporality,
start_time_unix_nano: int,
reservoir_builder: ExemplarReservoirBuilder,
boundaries: Optional[Sequence[float]] = None,
boundaries: Optional[Union[Sequence[float], Sequence[int]]] = None,
record_min_max: bool = True,
):
if boundaries is None:
Expand Down Expand Up @@ -1276,7 +1285,7 @@ def _create_aggregation(
)

if isinstance(instrument, Histogram):
boundaries: Optional[Sequence[float]] = (
boundaries: Optional[Union[Sequence[float], Sequence[int]]] = (
instrument._advisory.get("explicit_bucket_boundaries")
if instrument._advisory is not None
else None
Expand Down Expand Up @@ -1361,7 +1370,7 @@ class ExplicitBucketHistogramAggregation(Aggregation):

def __init__(
self,
boundaries: Optional[Sequence[float]] = None,
boundaries: Optional[Union[Sequence[float], Sequence[int]]] = None,
record_min_max: bool = True,
) -> None:
if boundaries is None:
Expand Down

0 comments on commit c148618

Please sign in to comment.