Skip to content

JunjoOtelExporter

junjo.telemetry.junjo_otel_exporter.JunjoOtelExporter

Kind: Class

SDK version: 0.64.0

Documentation channel: Next source preview

JunjoOtelExporter(host: str, port: str, api_key: str, insecure: bool = False)

View source

Configure Junjo AI Studio OTLP components for an existing OpenTelemetry setup.

Junjo is designed to be compatible with existing OpenTelemetry configurations, by adding to an existing configuration instead of creating a new one.

In normal applications, the tracer provider and meter provider remain the top-level owners of shutdown. Call TracerProvider.shutdown() and MeterProvider.shutdown() when the process is terminating.

flush is available for manual immediate export when you truly need it, such as in short-lived scripts or tests. shutdown is a wrapper-local helper that shuts down only the Junjo-owned span processor and metric reader.

Name Type Description Default
host str The hostname of the Junjo AI Studio.
port str The port of the Junjo AI Studio.
api_key str The API key for the Junjo AI Studio.
insecure bool Whether to allow insecure connections to the Junjo AI Studio.
Defaults to False.
False

Initializes the JunjoOtelExporter.

span_processor: BatchSpanProcessor

View source

Returns the configured span processor.

metric_reader: PeriodicExportingMetricReader

View source

Returns the configured metric reader.

shutdown(timeout_millis: float = 30000) -> bool

View source

Shut down the Junjo-owned telemetry components.

In most applications, the preferred terminal lifecycle is to shut down the owning TracerProvider and MeterProvider. This helper is provided for cases where you need to shut down only the Junjo-owned span processor and metric reader directly.

Name Type Description Default
timeout_millis float Maximum time to wait for metric reader shutdown
in milliseconds. Defaults to 30000.
30000
  • bool: True if both components shut down cleanly, False if either shutdown path raises. Failures are logged through the junjo.telemetry logger.

flush(timeout_millis: float = 120000) -> bool

View source

Force a manual drain of pending telemetry.

This method blocks until pending telemetry is exported or the timeout is reached. Use it only when you need an immediate manual export, such as in tests, short-lived scripts, or other environments where the normal provider shutdown lifecycle is not the right fit.

In normal applications, shut down the owning TracerProvider and MeterProvider instead of using flush as the standard exit path.

Name Type Description Default
timeout_millis float Maximum time to wait for flush in milliseconds.
Defaults to 120000ms (120 seconds) to match the
exporter timeout and allow for retries.
120000
  • bool: True if all telemetry was flushed successfully, False otherwise. Failures are logged through the junjo.telemetry logger.