该网页没有给出太多相同的描述,如果可能的话分享一些例子。
public class MainVerticle extends AbstractVerticle {
Tracer tracer=GlobalTracer.getTracer();
@Override
public void start() {
vertx.deployVerticle(new MainVerticle());
Router router =Router.router(vertx);
router.get("/home").handler(this::message);
router.get("/home/:name").handler(this::messagectm);
Tracer tracer = getTracer();
vertx.createHttpServer(new HttpServerOptions().setTracingPolicy(TracingPolicy.ALWAYS)).requestHandler(router).listen(8080);
Span span = tracer.buildSpan("my-operation")
.withTag("example", "test")
.start();
OpenTracingUtil.setSpan(span);
DeliveryOptions options = new DeliveryOptions().setTracingPolicy(TracingPolicy.ALWAYS);
vertx.eventBus().send("addr","test",options);
span.finish();
}
这是我尝试过但没有按预期工作的示例实现