Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import warnings
from os import environ
from time import time_ns
from typing import Any, Callable, Optional, Tuple, Union # noqa
from typing import Callable, Dict, List, Optional, Tuple, Union # noqa

from opentelemetry._logs import Logger as APILogger
from opentelemetry._logs import LoggerProvider as APILoggerProvider
Expand Down Expand Up @@ -69,6 +69,10 @@ class LogDroppedAttributesWarning(UserWarning):

warnings.simplefilter("once", LogDroppedAttributesWarning)

OtelAny = Union[
str, bool, int, float, bytes, List["OtelAny"], Dict[str, "OtelAny"], None
]


class LogLimits:
"""This class is based on a SpanLimits class in the Tracing module.
Expand Down Expand Up @@ -179,7 +183,7 @@ def __init__(
trace_flags: Optional[TraceFlags] = None,
severity_text: Optional[str] = None,
severity_number: Optional[SeverityNumber] = None,
body: Optional[Any] = None,
body: Optional[OtelAny] = None,
resource: Optional[Resource] = None,
attributes: Optional[Attributes] = None,
limits: Optional[LogLimits] = _UnsetLogLimits,
Expand Down Expand Up @@ -381,8 +385,8 @@ def add_log_record_processor(
def _submit_and_wait(
self,
func: Callable[[LogRecordProcessor], Callable[..., None]],
*args: Any,
**kwargs: Any,
*args: OtelAny,
**kwargs: OtelAny,
):
futures = []
for lp in self._log_record_processors:
Expand Down