ant_ai.observer.composite
CompositeSink
Fans out all observability calls to a list of sinks.
Each method is dispatched to all sinks concurrently. Errors from
individual sinks are swallowed via return_exceptions=True so a
failing sink never affects the others.
Source code in src/ant_ai/observer/composite.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | |
__init__
__init__(sinks: list[Any]) -> None
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sinks
|
list[Any]
|
|
required |
Source code in src/ant_ai/observer/composite.py
16 17 18 19 20 21 | |
event
async
event(name: str, **fields) -> None
Fans out the event to all sinks concurrently.
Source code in src/ant_ai/observer/composite.py
23 24 25 26 27 28 | |
exception
async
exception(name: str, error: Exception, **fields) -> None
Fans out the error event to all sinks concurrently.
Source code in src/ant_ai/observer/composite.py
30 31 32 33 34 35 | |
span
async
span(name: str, **attrs)
Opens a span on all sinks concurrently and closes them on exit.
Source code in src/ant_ai/observer/composite.py
37 38 39 40 41 42 43 | |
propagation_headers
propagation_headers() -> dict[str, str]
Merges propagation headers from all sinks.
Source code in src/ant_ai/observer/composite.py
45 46 47 48 49 50 | |
attach_propagation_context
attach_propagation_context(headers: dict[str, str])
Restores propagation context in all sinks.
Source code in src/ant_ai/observer/composite.py
52 53 54 55 56 57 58 | |