Package com.ants.platform.otel
Class AntsPlatformOtel
java.lang.Object
com.ants.platform.otel.AntsPlatformOtel
Entry point for configuring Agentic Ants OpenTelemetry tracing.
Wires an AntsPlatformSpanProcessor into an SdkTracerProvider
and registers it as the global OpenTelemetry instance, so the
high-level com.ants.platform.tracing.Ants API and any other OTel
instrumentation in the process export to the platform.
AntsPlatformOtel.configure(AntsPlatformOtel.options()
.publicKey("pk-ap-...")
.secretKey("sk-ap-...")); // baseUrl defaults to https://api.agenticants.ai
// ... instrument with Ants.startObservation(...) / startActiveObservation(...) ...
AntsPlatformOtel.shutdown(); // flush before the process exits
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringSDK version reported on thex_antsPlatform_sdk_versionheader. -
Method Summary
Modifier and TypeMethodDescriptionstatic io.opentelemetry.api.OpenTelemetryRegisters a pre-built processor as the global tracer provider.static io.opentelemetry.api.OpenTelemetryBuilds the span processor fromoptions, registers a globalOpenTelemetry, and returns it.static voidflush()Flushes any buffered spans without tearing down the provider.static AntsPlatformSpanProcessorThe active processor, ornullifconfigure(com.ants.platform.otel.AntsPlatformSpanProcessor.Builder)has not run.static StringThe resolved project id (for agent_id derivation), ornullif unavailable.options()Mutable options forconfigure(com.ants.platform.otel.AntsPlatformSpanProcessor.Builder).static voidshutdown()Flushes and shuts down the tracer provider.
-
Field Details
-
SDK_VERSION
SDK version reported on thex_antsPlatform_sdk_versionheader.- See Also:
-
-
Method Details
-
options
Mutable options forconfigure(com.ants.platform.otel.AntsPlatformSpanProcessor.Builder). Delegates to the processor builder. -
configure
public static io.opentelemetry.api.OpenTelemetry configure(AntsPlatformSpanProcessor.Builder options) Builds the span processor fromoptions, registers a globalOpenTelemetry, and returns it.- Parameters:
options- processor options (seeoptions())- Returns:
- the registered
OpenTelemetryinstance
-
configure
Registers a pre-built processor as the global tracer provider. -
getProcessor
The active processor, ornullifconfigure(com.ants.platform.otel.AntsPlatformSpanProcessor.Builder)has not run. -
getProjectId
The resolved project id (for agent_id derivation), ornullif unavailable. -
flush
public static void flush()Flushes any buffered spans without tearing down the provider. -
shutdown
public static void shutdown()Flushes and shuts down the tracer provider. Call before process exit.
-