Vertx OpenTracing
Vert.x integrates with OpenTracing thanks to the Jaeger client.
You can configure Vert.x to use the Jaeger client configured via Environment
Vertx vertx = Vertx.vertx(new VertxOptions()
.setTracingOptions(
new OpenTracingOptions()
)
);
You can also pass a custom Tracer
allowing for greater control
over the configuration.
Vertx vertx = Vertx.vertx(new VertxOptions()
.setTracingOptions(
new OpenTracingOptions(tracer)
)
);
Tracing policy
The tracing policy defines the behavior of a component when tracing is enabled:
The tracing policy is usually configured in the component options.
HTTP tracing
The Vert.x HTTP server and client reports span around HTTP requests:
-
operationName
: the HTTP method -
tags
-
http.method
: the HTTP method -
http.url
: the request URL -
http.status_code
: the HTTP status code
The default HTTP server tracing policy is ALWAYS
, you can configure the policy with setTracingPolicy
HttpServer server = vertx.createHttpServer(new HttpServerOptions()
.setTracingPolicy(TracingPolicy.IGNORE)
);
The default HTTP client tracing policy is PROPAGATE
, you can configure the policy with setTracingPolicy
HttpClient client = vertx.createHttpClient(new HttpClientOptions()
.setTracingPolicy(TracingPolicy.IGNORE)
);