Skip to content

API Reference parrot.observability.exporters

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot.observability.exporters

View source

OTLP exporter factory helpers.

FEAT-177 TASK-1234.

Factory functions returning OTLP span and metric exporters configured from ObservabilityConfig. Supports both http/protobuf (default) and grpc protocols. gRPC exporters are lazy-imported so users without grpcio installed are not broken when they choose the HTTP default. The plural make_span_exporters / make_metric_exporters build one exporter per OtlpTarget (FEAT-462, FEAT-705).

Spec §3 Module 7.

Alias ObservabilityConfig

Re-exported from parrot.observability.config.ObservabilityConfig.

Alias OtlpTarget

Re-exported from parrot.observability.config.OtlpTarget.

Function make_metric_exporter

Return an OTLP metric exporter configured from config.

make_metric_exporter(config: ObservabilityConfig) -> Any

Parameter Type Default Description
config ObservabilityConfig ObservabilityConfig instance providing endpoint, protocol, and optional headers.

Returns: Any — An OTLPMetricExporter instance (HTTP or gRPC variant).

Raises:

  • ImportError — When protocol="grpc" is requested but the gRPC exporter package is not installed.

Function make_metric_exporters

Return one OTLP metric exporter per targets entry (FEAT-705).

Multi-endpoint counterpart to :func:make_metric_exporter, shaped exactly like :func:make_span_exporters. setup_telemetry() wraps each exporter in its own PeriodicExportingMetricReader on a single shared MeterProvider; there is no composite metric exporter.

make_metric_exporters(targets: list[OtlpTarget], protocol: str = 'http/protobuf') -> list[Any]

Parameter Type Default Description
targets list[OtlpTarget] List of OTLP export destinations.
protocol str 'http/protobuf' Shared transport protocol for all targets ("http/protobuf" or "grpc").

Returns: list[Any] — A list of exporter instances, one per target, in the same order as targets. Empty list when targets is empty.

Raises:

  • ImportError — When protocol="grpc" is requested but the gRPC exporter package is not installed.

Function make_span_exporter

Return an OTLP span exporter configured from config.

make_span_exporter(config: ObservabilityConfig) -> Any

Parameter Type Default Description
config ObservabilityConfig ObservabilityConfig instance providing endpoint, protocol, and optional headers.

Returns: Any — An OTLPSpanExporter instance (HTTP or gRPC variant).

Raises:

  • ImportError — When protocol="grpc" is requested but the gRPC exporter package is not installed.

Function make_span_exporters

Return one OTLP span exporter per targets entry (FEAT-462).

Multi-endpoint counterpart to :func:make_span_exporter. Each target gets its own exporter built from its endpoint/headers; all targets share the same protocol. This is how setup_telemetry() attaches one BatchSpanProcessor per target to a single shared TracerProvider — there is no CompositeSpanExporter in the OTel SDK.

make_span_exporters(targets: list[OtlpTarget], protocol: str = 'http/protobuf') -> list[Any]

Parameter Type Default Description
targets list[OtlpTarget] List of OTLP export destinations.
protocol str 'http/protobuf' Shared transport protocol for all targets ("http/protobuf" or "grpc").

Returns: list[Any] — A list of exporter instances, one per target, in the same order as targets. Empty list when targets is empty.

Raises:

  • ImportError — When protocol="grpc" is requested but the gRPC exporter package is not installed.

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally