Package io.vertx.tracing.opentracing

## Class OpenTracingTracer

- java.lang.Object
- - io.vertx.tracing.opentracing.OpenTracingTracer

- All Implemented Interfaces:
    `VertxTracer<io.opentracing.Span,​io.opentracing.Span>`

      public class OpenTracingTracer
      extends Object
      implements VertxTracer<io.opentracing.Span,​io.opentracing.Span>

  - https://github.com/opentracing/specification/blob/master/semantic_conventions.md - https://github.com/opentracing/specification/blob/master/specification.md

- - ### Field Summary

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

      `NOOP`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `OpenTracingTracer​(boolean closeTracer, io.opentracing.Tracer tracer)` | Instantiate a OpenTracing tracer using the specified `tracer`.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `close()` | Close the tracer.
    `<R> io.opentracing.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, io.opentracing.Span span, Throwable failure, TagExtractor<R> tagExtractor)` | Signal a response has been received.
    `<R> io.opentracing.Span` | `sendRequest​(Context context, SpanKind kind, TracingPolicy policy, R request, String operation, BiConsumer<String,​String> headers, TagExtractor<R> tagExtractor)` | Signal a request is sent.
    `<R> void` | `sendResponse​(Context context, R response, io.opentracing.Span span, Throwable failure, TagExtractor<R> tagExtractor)` | Signal the response is sent.

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

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

- - ### Constructor Detail

    - #### OpenTracingTracer

          public OpenTracingTracer​(boolean closeTracer,
                                   io.opentracing.Tracer tracer)

      Instantiate a OpenTracing tracer using the specified `tracer`.
      Parameters:
        `closeTracer` - close the tracer when necessary
        `tracer` - the tracer instance

  - ### Method Detail

    - #### receiveRequest

          public <R> io.opentracing.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<io.opentracing.Span,​io.opentracing.Span>`
      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,
                                       io.opentracing.Span span,
                                       Throwable failure,
                                       TagExtractor<R> tagExtractor)

      Description copied from interface: `VertxTracer`
      Signal the response is sent.
      Specified by:
        `sendResponse` in interface `VertxTracer<io.opentracing.Span,​io.opentracing.Span>`
      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> io.opentracing.Span sendRequest​(Context context,
                                                     SpanKind kind,
                                                     TracingPolicy policy,
                                                     R request,
                                                     String operation,
                                                     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<io.opentracing.Span,​io.opentracing.Span>`
      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,
                                          io.opentracing.Span span,
                                          Throwable failure,
                                          TagExtractor<R> tagExtractor)

      Description copied from interface: `VertxTracer`
      Signal a response has been received.
      Specified by:
        `receiveResponse` in interface `VertxTracer<io.opentracing.Span,​io.opentracing.Span>`
      Parameters:
        `context` - the context data attached to the request
        `response` - the response sent
        `span` - 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<io.opentracing.Span,​io.opentracing.Span>`