JunjoOtelExporter
junjo.telemetry.junjo_otel_exporter.JunjoOtelExporter
Kind: Class
SDK version: 0.64.0
Documentation channel: Next source preview
Signature
Section titled “Signature”JunjoOtelExporter(host: str, port: str, api_key: str, insecure: bool = False)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.
Parameters
Section titled “Parameters”| 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 |
Constructor
Section titled “Constructor”Initializes the JunjoOtelExporter.
Members
Section titled “Members”span_processor
Section titled “span_processor”span_processor: BatchSpanProcessorReturns the configured span processor.
metric_reader
Section titled “metric_reader”metric_reader: PeriodicExportingMetricReaderReturns the configured metric reader.
shutdown
Section titled “shutdown”shutdown(timeout_millis: float = 30000) -> boolShut 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.
Parameters
Section titled “Parameters”| Name | Type | Description | Default |
|---|---|---|---|
timeout_millis |
float |
Maximum time to wait for metric reader shutdown in milliseconds. Defaults to 30000. |
30000 |
Returns
Section titled “Returns”bool:Trueif both components shut down cleanly,Falseif either shutdown path raises. Failures are logged through thejunjo.telemetrylogger.
flush(timeout_millis: float = 120000) -> boolForce 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.
Parameters
Section titled “Parameters”| 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 |
Returns
Section titled “Returns”bool:Trueif all telemetry was flushed successfully,Falseotherwise. Failures are logged through thejunjo.telemetrylogger.