io.vertx.tracing.zipkin

## Class ZipkinTracer

- java.lang.Object
- - io.vertx.tracing.zipkin.ZipkinTracer

- All Implemented Interfaces:
    VertxTracer<brave.Span,java.util.function.BiConsumer<Object,Throwable>>

      public class ZipkinTracer
      extends Object
      implements VertxTracer<brave.Span,java.util.function.BiConsumer<Object,Throwable>>

  - https://zipkin.io/pages/instrumenting.html - https://zipkin.io/public/thrift/v1/zipkinCore.html

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `ACTIVE_CONTEXT`
    `static String` | `ACTIVE_REQUEST`
    `static String` | `ACTIVE_SPAN`

    - ### Fields inherited from interface io.vertx.core.spi.tracing.VertxTracer

      `NOOP`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ZipkinTracer(boolean closeTracer, brave.http.HttpTracing httpTracing, VertxSender sender)`
    `ZipkinTracer(boolean closeTracer, brave.Tracing tracing, VertxSender sender)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static brave.propagation.TraceContext` | `activeContext()`
    `static brave.Span` | `activeSpan()`
    `static void` | `clearContext()` Remove any active context.
    `static void` | `clearSpan()` Remove any active span.
    `void` | `close()` Close the tracer.
    `static String` | `exportTraceId()` Export active traceId otherwise `null`.
    `brave.Tracing` | `getTracing()`
    `static void` | `importTraceId(String traceId)` Import traceId.
    `<R> brave.Span` | `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.
    `<R> void` | `receiveResponse(Context context, R response, java.util.function.BiConsumer<Object,Throwable> payload, Throwable failure, TagExtractor<R> tagExtractor)` Signal a response has been received.
    `VertxSender` | `sender()`
    `<R> java.util.function.BiConsumer<Object,Throwable>` | `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.
    `<R> void` | `sendResponse(Context context, R response, brave.Span span, Throwable failure, TagExtractor<R> tagExtractor)` Signal the response is sent.
    `static void` | `setSpan(brave.Span span)` Set active `Span`.
    `static void` | `setTraceContext(brave.propagation.TraceContext context)` Set active `TraceContext`.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### ACTIVE_SPAN

          public static final String ACTIVE_SPAN

      See Also:
        Constant Field Values

    - #### ACTIVE_CONTEXT

          public static final String ACTIVE_CONTEXT

      See Also:
        Constant Field Values

    - #### ACTIVE_REQUEST

          public static final String ACTIVE_REQUEST

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### ZipkinTracer

          public ZipkinTracer(boolean closeTracer,
                              brave.Tracing tracing,
                              VertxSender sender)

    - #### ZipkinTracer

          public ZipkinTracer(boolean closeTracer,
                              brave.http.HttpTracing httpTracing,
                              VertxSender sender)

  - ### Method Detail

    - #### sender

          public VertxSender sender()

    - #### activeSpan

          public static brave.Span activeSpan()

      Returns:
        the current active `Span` otherwise `null`

    - #### activeContext

          public static brave.propagation.TraceContext activeContext()

      Returns:
        the current active `TraceContext` otherwise `null`

    - #### getTracing

          public brave.Tracing getTracing()

    - #### receiveRequest

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

      Description copied from interface: `VertxTracer`
      Signal a request has been received and will be processed.
      Specified by:
        `receiveRequest` in interface `VertxTracer<brave.Span,java.util.function.BiConsumer<Object,Throwable>>`
      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

          public <R> void sendResponse(Context context,
                                       R response,
                                       brave.Span span,
                                       Throwable failure,
                                       TagExtractor<R> tagExtractor)

      Description copied from interface: `VertxTracer`
      Signal the response is sent.
      Specified by:
        `sendResponse` in interface `VertxTracer<brave.Span,java.util.function.BiConsumer<Object,Throwable>>`
      Parameters:
        `context` - the context data attached to the request
        `response` - the response sent
        `span` - the payload returned by `VertxTracer.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

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

      Description copied from interface: `VertxTracer`
      Signal a request is sent.

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

      Specified by:
        `sendRequest` in interface `VertxTracer<brave.Span,java.util.function.BiConsumer<Object,Throwable>>`
      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

          public <R> void receiveResponse(Context context,
                                          R response,
                                          java.util.function.BiConsumer<Object,Throwable> payload,
                                          Throwable failure,
                                          TagExtractor<R> tagExtractor)

      Description copied from interface: `VertxTracer`
      Signal a response has been received.
      Specified by:
        `receiveResponse` in interface `VertxTracer<brave.Span,java.util.function.BiConsumer<Object,Throwable>>`
      Parameters:
        `context` - the context data attached to the request
        `response` - the response sent
        `payload` - the payload returned by `VertxTracer.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

          public void close()

      Description copied from interface: `VertxTracer`
      Close the tracer.
      Specified by:
        `close` in interface `VertxTracer<brave.Span,java.util.function.BiConsumer<Object,Throwable>>`

    - #### clearContext

          public static void clearContext()

      Remove any active context.

    - #### clearSpan

          public static void clearSpan()

      Remove any active span.

    - #### importTraceId

          public static void importTraceId(String traceId)

      Import traceId.

    - #### exportTraceId

          public static String exportTraceId()

      Export active traceId otherwise `null`.

    - #### setTraceContext

          public static void setTraceContext(brave.propagation.TraceContext context)

      Set active `TraceContext`.

    - #### setSpan

          public static void setSpan(brave.Span span)

      Set active `Span`.

Copyright © 2022 Eclipse. All rights reserved.