Skip to main content
function Exporters.add
def Exporters.add(
*,
url: None | str = None,
file: None | str = None,
protocol: None | str = None,
format: None | str = None,
headers: dict[str, str] = …,
signals: list[str] = [],
resource_attributes: dict[str, str] = …
) -> None
Register an exporter. The runtime builds the corresponding sink after phase 3 and replays any buffered spans/logs into it. Exactly one of url (OTLP exporter) or file (local file/stderr/stdout exporter) must be provided. Args (OTLP shape): url: OTLP collector URL protocol: β€œgrpc” (default) or β€œhttp/protobuf” headers: optional dict[str,str] for auth/tenant routing Args (file shape): file: filesystem path, or β€œstderr” / β€œstdout” format: β€œcompact” (default, one human-readable line per record) or β€œjsonl” (one JSON object per line, machine-parseable) Common args: signals: optional list, subset of [β€œtraces”, β€œlogs”, β€œmetrics”]; default is all three resource_attributes: optional dict[str,str] merged into the exporter’s Resource