io.vertx.core.spi.tracing

## Interface VertxTracer<I,O>

- All Known Implementing Classes:
    OpenTracingTracer, ZipkinTracer

      public interface VertxTracer<I,O>

  The tracer SPI used by Vert.x components to report activities.
  Author:
    Julien Viet

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static VertxTracer` | `NOOP` Noop tracer.

  - ### Method Summary

    All Methods Instance Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `default void` | `close()` Close the tracer.
    `default <R> I` | `receiveRequest(Context context, SpanKind kind, TracingPolicy policy, R request, String operation, Iterable<Map.Entry<String,String>> headers, TagExtractor<R> tagExtractor)` Signal a request has been received and will be processed.
    `default <R> void` | `receiveResponse(Context context, R response, O payload, Throwable failure, TagExtractor<R> tagExtractor)` Signal a response has been received.
    `default <R> O` | `sendRequest(Context context, SpanKind kind, TracingPolicy policy, R request, String operation, java.util.function.BiConsumer<String,String> headers, TagExtractor<R> tagExtractor)` Signal a request is sent.
    `default <R> void` | `sendResponse(Context context, R response, I payload, Throwable failure, TagExtractor<R> tagExtractor)` Signal the response is sent.

- - ### Field Detail

    - #### NOOP

          static final VertxTracer NOOP

      Noop tracer.

  - ### Method Detail

    - #### receiveRequest

          default <R> I receiveRequest(Context context,
                                       SpanKind kind,
                                       TracingPolicy policy,
                                       R request,
                                       String operation,
                                       Iterable<Map.Entry<String,String>> headers,
                                       TagExtractor<R> tagExtractor)

      Signal a request has been received and will be processed.
      Parameters:
        `context` - the context data attached to the request
        `kind` - the span kind
        `policy` - the policy to apply
        `request` - the request object
        `operation` - the request operation
        `headers` - a read-only view of the request headers
        `tagExtractor` - the request tag extractor
      Returns:
        the request trace

    - #### sendResponse

          default <R> void sendResponse(Context context,
                                        R response,
                                        I payload,
                                        Throwable failure,
                                        TagExtractor<R> tagExtractor)

      Signal the response is sent.
      Parameters:
        `context` - the context data attached to the request
        `response` - the response sent
        `payload` - the payload returned by `receiveRequest(io.vertx.core.Context, io.vertx.core.spi.tracing.SpanKind, io.vertx.core.tracing.TracingPolicy, R, java.lang.String, java.lang.Iterable<java.util.Map.Entry<java.lang.String, java.lang.String>>, io.vertx.core.spi.tracing.TagExtractor<R>)`
        `failure` - the failure when not `null`
        `tagExtractor` - the response tag extractor

    - #### sendRequest

          default <R> O sendRequest(Context context,
                                    SpanKind kind,
                                    TracingPolicy policy,
                                    R request,
                                    String operation,
                                    java.util.function.BiConsumer<String,String> headers,
                                    TagExtractor<R> tagExtractor)

      Signal a request is sent.

      When the method returns `null`, no propagation happens and the client shall not call `receiveResponse(io.vertx.core.Context, R, O, java.lang.Throwable, io.vertx.core.spi.tracing.TagExtractor<R>)`.

      Parameters:
        `context` - the context data attached to the request
        `kind` - the span kind
        `policy` - the policy to apply
        `request` - the request object
        `operation` - the request operation
        `headers` - a write only-view of the request headers
        `tagExtractor` - the request tag extractor
      Returns:
        the request trace

    - #### receiveResponse

          default <R> void receiveResponse(Context context,
                                           R response,
                                           O payload,
                                           Throwable failure,
                                           TagExtractor<R> tagExtractor)

      Signal a response has been received.
      Parameters:
        `context` - the context data attached to the request
        `response` - the response sent
        `payload` - the payload returned by `sendRequest(io.vertx.core.Context, io.vertx.core.spi.tracing.SpanKind, io.vertx.core.tracing.TracingPolicy, R, java.lang.String, java.util.function.BiConsumer<java.lang.String, java.lang.String>, io.vertx.core.spi.tracing.TagExtractor<R>)`
        `failure` - the failure when not `null`
        `tagExtractor` - the response tag extractor

    - #### close

          default void close()

      Close the tracer.

Copyright © 2025 Eclipse. All rights reserved.