JunjoOtelExporter
junjo.telemetry.junjo_otel_exporter.JunjoOtelExporter
Kind: Class
SDK version: 0.67.0
Documentation channel: Stable release
Signature
Section titled “Signature”JunjoOtelExporter(endpoint: str, api_key: str, insecure: bool = False)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.
Parameters
Section titled “Parameters”| 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 |
Constructor
Section titled “Constructor”Initializes the JunjoOtelExporter.
Members
Section titled “Members”span_processor
Section titled “span_processor”span_processor: BatchSpanProcessorReturns the configured span processor.
shutdown
Section titled “shutdown”shutdown() -> boolShut 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.
Returns
Section titled “Returns”bool:Trueif the span processor shuts down cleanly,Falseif shutdown raises. Failures are logged through thejunjo.telemetrylogger.
flush(timeout_millis: float = 120000) -> boolRequest 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.
Parameters
Section titled “Parameters”| 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 |
Returns
Section titled “Returns”bool:Trueif the span processor reports its local drain complete,Falseif it refuses or raises. This does not attest collector acceptance. Surfaced failures are logged through thejunjo.telemetrylogger.