本文整理汇总了Java中com.github.kristofa.brave.SpanCollector类的典型用法代码示例。如果您正苦于以下问题:Java SpanCollector类的具体用法?Java SpanCollector怎么用?Java SpanCollector使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SpanCollector类属于com.github.kristofa.brave包,在下文中一共展示了SpanCollector类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: applySpanCollector
import com.github.kristofa.brave.SpanCollector; //导入依赖的package包/类
private static Brave.Builder applySpanCollector(final Brave.Builder builder, final JsonObject json) {
SpanCollector spanCollector;
switch (json.getString("type")) {
case "logging":
spanCollector = new LoggingSpanCollector();
break;
case "scribe":
spanCollector = ScribeSpanCollectorBuilder.build(json);
break;
case "kafka":
spanCollector = KafkaSpanCollectorBuilder.build(json);
break;
case "empty":
default:
spanCollector = new EmptySpanCollector();
}
logger.debug("Configuring span collector: {}", spanCollector);
return builder.spanCollector(spanCollector);
}
示例2: spanCollector
import com.github.kristofa.brave.SpanCollector; //导入依赖的package包/类
@Bean
public SpanCollector spanCollector() {
HttpSpanCollector.Config config =
HttpSpanCollector.Config.builder()
.connectTimeout(properties.getConnectTimeout())
.readTimeout(properties.getReadTimeout())
.compressionEnabled(properties.isCompressionEnabled())
.flushInterval(properties.getFlushInterval())
.build();
return HttpSpanCollector.create(
properties.getUrl(), config, new EmptySpanCollectorMetricsHandler());
}
示例3: TracedSession
import com.github.kristofa.brave.SpanCollector; //导入依赖的package包/类
TracedSession(Session target, Brave brave, SpanCollector collector) {
this.target = checkNotNull(target, "target");
this.brave = checkNotNull(brave, "brave");
this.collector = checkNotNull(collector, "collector");
this.version = target.getCluster().getConfiguration().getProtocolOptions().getProtocolVersion();
target.getCluster().register(this);
}
示例4: build
import com.github.kristofa.brave.SpanCollector; //导入依赖的package包/类
public static SpanCollector build(final JsonObject json) {
KafkaSpanCollector.Config.Builder conf = KafkaSpanCollector.Config.builder(json.getString("bootstrapServers", "localhost"))
.flushInterval(json.getInteger("flushInterval", 1))
.topic(json.getString("topic", "zipkin"));
return KafkaSpanCollector.create(conf.build(), new EmptySpanCollectorMetricsHandler());
}
示例5: spanCollector
import com.github.kristofa.brave.SpanCollector; //导入依赖的package包/类
@Bean
@Scope(value = "singleton")
public SpanCollector spanCollector() {
// For development purposes we use the logging span collector.
return new LoggingSpanCollectorImpl();
//return new ZipkinSpanCollector("localhost", 9410);
}
示例6: create
import com.github.kristofa.brave.SpanCollector; //导入依赖的package包/类
public static Session create(Session target, Brave brave, SpanCollector collector) {
return Reflection.newProxy(Session.class, new TracedSession(target, brave, collector));
}
示例7: setSpanCollector
import com.github.kristofa.brave.SpanCollector; //导入依赖的package包/类
public void setSpanCollector(SpanCollector spanCollector) {
this.spanCollector = spanCollector;
}
示例8: build
import com.github.kristofa.brave.SpanCollector; //导入依赖的package包/类
public static SpanCollector build(final JsonObject json) {
return new ScribeSpanCollector(json.getString("host", "localhost"),
json.getInteger("port", 8410),
getParams(json.getJsonObject("params", new JsonObject())));
}
示例9: getSpanCollector
import com.github.kristofa.brave.SpanCollector; //导入依赖的package包/类
public SpanCollector getSpanCollector() {
return spanCollector;
}
示例10: setSpanCollector
import com.github.kristofa.brave.SpanCollector; //导入依赖的package包/类
/**
* The collector to use for sending zipkin span events to the zipkin server.
*/
public void setSpanCollector(SpanCollector spanCollector) {
this.spanCollector = spanCollector;
}