Skip to main content

module  opentelemetry.instrumentation.pixeltable

OpenTelemetry instrumentation for Pixeltable. Translates Pixeltable’s instrumentation hooks into OpenTelemetry spans and metrics. Instrumentation is opt-in: either attach to an existing OpenTelemetry SDK with PixeltableInstrumentor, or let init build providers from Pixeltable’s [otel] config.

func  init()

Signature
Configure pixeltable’s OpenTelemetry instrumentation and start emitting telemetry. Call once, before the first Pixeltable operation. Each argument overrides the matching [otel] config setting and its standard OTEL_* environment variable; when an argument is left as None the value resolves from that env var (highest priority) then the [otel] config section. Pass tracer_provider/meter_provider to instrument against an SDK your application owns instead. Parameters:
  • endpoint (str | None): OTLP collector endpoint (eg http://localhost:4318); resolves from otel.exporter_otlp_endpoint / OTEL_EXPORTER_OTLP_ENDPOINT. With no endpoint configured and no application-owned provider, instrumentation stays inert and exports nothing.
  • protocol (str | None): OTLP transport, http/protobuf (default) or grpc; resolves from otel.exporter_otlp_protocol / OTEL_EXPORTER_OTLP_PROTOCOL.
  • service_name (str | None): service.name resource attribute (default pixeltable); resolves from otel.service_name / OTEL_SERVICE_NAME.
  • headers (str | None): OTLP headers as comma-separated key=value pairs; resolves from otel.exporter_otlp_headers / OTEL_EXPORTER_OTLP_HEADERS.
  • span_level (Literal['info', 'debug', 'trace'] | None): span emission threshold: info (default; operation-level spans only), debug (adds per-row and per-UDF spans), or trace.
  • metrics (bool | None): force metric export on/off (by default metrics are exported only when an OTLP endpoint is configured).
  • logs (bool | None): force log export on/off (default off; must be explicitly enabled).
  • tracer_provider (Any): an existing TracerProvider to instrument against.
  • meter_provider (Any): an existing MeterProvider to instrument against.
Examples:
Last modified on July 20, 2026