com.smoketurner.dropwizard.zipkin.client.ZipkinClientConfiguration.getServiceName()方法的使用及代码示例

x33g5p2x  于2022-02-05 转载在 其他  
字(1.5k)|赞(0)|评价(0)|浏览(62)

本文整理了Java中com.smoketurner.dropwizard.zipkin.client.ZipkinClientConfiguration.getServiceName()方法的一些代码示例,展示了ZipkinClientConfiguration.getServiceName()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZipkinClientConfiguration.getServiceName()方法的具体详情如下:
包路径:com.smoketurner.dropwizard.zipkin.client.ZipkinClientConfiguration
类名称:ZipkinClientConfiguration
方法名:getServiceName

ZipkinClientConfiguration.getServiceName介绍

暂无

代码示例

代码示例来源:origin: smoketurner/dropwizard-zipkin

/**
 * Build a new Jersey Client that is instrumented for Zipkin
 *
 * @param configuration Configuration to use for the client
 * @return new Jersey Client
 */
public Client build(final ZipkinClientConfiguration configuration) {
 final Client client =
   new JerseyClientBuilder(environment)
     .using(configuration)
     .build(configuration.getServiceName());
 return build(client);
}

代码示例来源:origin: smoketurner/dropwizard-zipkin

@Override
 public void run(HelloWorldConfiguration configuration, Environment environment) throws Exception {

  final Optional<HttpTracing> tracing = configuration.getZipkinFactory().build(environment);

  final Client client;
  if (tracing.isPresent()) {
   client =
     new ZipkinClientBuilder(environment, tracing.get())
       .build(configuration.getZipkinClient());
  } else {
   final ZipkinClientConfiguration clientConfig = configuration.getZipkinClient();
   client =
     new JerseyClientBuilder(environment)
       .using(clientConfig)
       .build(clientConfig.getServiceName());
  }

  // Register resources
  final HelloWorldResource resource = new HelloWorldResource(client);
  environment.jersey().register(resource);
 }
}

相关文章

ZipkinClientConfiguration类方法