OpenTelemetryInterceptorFactory

class OpenTelemetryInterceptorFactory : HandlerInterceptor.Factory, RunInterceptor.Factory

OpenTelemetry interceptor factory for Java handlers. Implements both and RunInterceptor.Factory so a single registration covers both invocation- and run-level spans.

  • Per invocation: opens an attempt <target> span (server kind) with restate.invocation.id and restate.invocation.target attributes. The parent span context is extracted from the incoming request headers via the configured .
  • Per ctx.run(name, ...) call: opens a run (<name>) child span with the restate.run.name attribute.

Scopes are thread-local. Use with OpenTelemetryRunContextPropagator (registered via SPI by default) to propagate spans to run closures.

Constructors

Link copied to clipboard
constructor(openTelemetry: OpenTelemetry)

Functions

Link copied to clipboard
open fun combine(factories: Stream<out HandlerInterceptor.Factory>): HandlerInterceptor
open fun combine(factories: Stream<out RunInterceptor.Factory>): RunInterceptor
Link copied to clipboard
@Nullable
open fun createHandlerInterceptor(): @Nullable HandlerInterceptor
Link copied to clipboard
@Nullable
open fun createRunInterceptor(): @Nullable RunInterceptor