Skip to content

JunjoOtelExporter

junjo.telemetry.junjo_otel_exporter.JunjoOtelExporter

Kind: Class

SDK version: 0.67.0

Documentation channel: Stable release

JunjoOtelExporter(endpoint: str, api_key: str, insecure: bool = False)

View source

Configure Junjo AI Studio trace export for an existing OpenTelemetry setup.

Junjo is designed to be compatible with existing OpenTelemetry configurations by adding a span processor instead of creating or replacing the application’s tracer provider.

Junjo AI Studio currently accepts OTLP traces only. This exporter therefore exposes a span_processor and does not create a meter provider, metric reader, or periodic metric-export worker. Applications that export metrics to another OpenTelemetry destination should configure that metric pipeline independently.

In normal applications, the tracer provider remains the top-level owner of shutdown. Call TracerProvider.shutdown() when the process is terminating.

flush is available for a manual local queue drain 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.

Name Type Description Default
endpoint str The OTLP/gRPC endpoint for Junjo AI Studio, including the
port, such as localhost:26155.
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.

shutdown() -> bool

View source

Shut down the Junjo-owned span processor.

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

  • bool: True if the span processor shuts down cleanly, False if shutdown raises. Failures are logged through the junjo.telemetry logger.

flush(timeout_millis: float = 120000) -> bool

View source

Request a manual drain of pending local telemetry.

Use it only when a short-lived script or test needs to ask the local batch processor to drain before normal provider shutdown.

OpenTelemetry’s batch processor does not propagate collector acceptance or durability through force_flush(). A True result therefore confirms only that the processor reported its local drain complete; it is not proof that Studio accepted or persisted the spans. Verify remote delivery through Studio’s query APIs when that guarantee matters. The installed OpenTelemetry processor may also apply its timeout as a best- effort budget rather than a strict deadline.

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

Name Type Description Default
timeout_millis float Best-effort local processor budget requested for
the drain, in milliseconds. The installed
OpenTelemetry processor may not enforce it as a
strict deadline. Defaults to 120000ms (120
seconds).
120000
  • bool: True if the span processor reports its local drain complete, False if it refuses or raises. This does not attest collector acceptance. Surfaced failures are logged through the junjo.telemetry logger.