本文整理了Java中brave.Tracing.tracer()
方法的一些代码示例,展示了Tracing.tracer()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Tracing.tracer()
方法的具体详情如下:
包路径:brave.Tracing
类名称:Tracing
方法名:tracer
[英]All tracing commands start with a Span. Use a tracer to create spans.
[中]所有跟踪命令都以Span开头。使用跟踪器创建跨距。
代码示例来源:origin: openzipkin/brave
TracingMessageListener(MessageListener delegate, JmsTracing jmsTracing, boolean addConsumerSpan) {
this.delegate = delegate;
this.jmsTracing = jmsTracing;
this.tracing = jmsTracing.tracing;
this.tracer = jmsTracing.tracing.tracer();
this.remoteServiceName = jmsTracing.remoteServiceName;
this.addConsumerSpan = addConsumerSpan;
}
代码示例来源:origin: openzipkin/brave
TracingValueTransformerWithKey(KafkaStreamsTracing kafkaStreamsTracing, String spanName,
ValueTransformerWithKey<K, V, VR> delegateTransformer) {
this.kafkaStreamsTracing = kafkaStreamsTracing;
this.tracer = kafkaStreamsTracing.tracing.tracer();
this.spanName = spanName;
this.delegateTransformer = delegateTransformer;
}
代码示例来源:origin: openzipkin/brave
TracingRabbitListenerAdvice(SpringRabbitTracing springRabbitTracing) {
this.springRabbitTracing = springRabbitTracing;
this.tracing = springRabbitTracing.tracing;
this.tracer = tracing.tracer();
this.remoteServiceName = springRabbitTracing.remoteServiceName;
}
代码示例来源:origin: openzipkin/brave
TracingProcessor(KafkaStreamsTracing kafkaStreamsTracing,
String spanName, Processor<K, V> delegateProcessor) {
this.kafkaStreamsTracing = kafkaStreamsTracing;
this.tracer = kafkaStreamsTracing.tracing.tracer();
this.spanName = spanName;
this.delegateProcessor = delegateProcessor;
}
代码示例来源:origin: openzipkin/brave
TracingProducer(Producer<K, V> delegate, KafkaTracing kafkaTracing) {
this.delegate = delegate;
this.kafkaTracing = kafkaTracing;
this.current = kafkaTracing.tracing.currentTraceContext();
this.tracer = kafkaTracing.tracing.tracer();
this.injector = kafkaTracing.injector;
this.extractor = kafkaTracing.extractor;
this.remoteServiceName = kafkaTracing.remoteServiceName;
}
代码示例来源:origin: openzipkin/brave
TracingServerInterceptor(GrpcTracing grpcTracing) {
tracer = grpcTracing.tracing.tracer();
extractor = grpcTracing.propagation.extractor(GETTER);
parser = grpcTracing.serverParser;
grpcPropagationFormatEnabled = grpcTracing.grpcPropagationFormatEnabled;
}
代码示例来源:origin: openzipkin/brave
TracingProducer(P delegate, JmsTracing jmsTracing) {
this.delegate = delegate;
this.jmsTracing = jmsTracing;
this.tracer = jmsTracing.tracing.tracer();
this.current = jmsTracing.tracing.currentTraceContext();
this.remoteServiceName = jmsTracing.remoteServiceName;
}
代码示例来源:origin: openzipkin/brave
/**
* Returns the most recently created tracer if its component hasn't been closed. null otherwise.
*
* <p>This object should not be cached.
*/
@Nullable public static Tracer currentTracer() {
Tracing tracing = current;
return tracing != null ? tracing.tracer() : null;
}
代码示例来源:origin: lettuce-io/lettuce-core
@Override
public Span nextSpan() {
return postProcessSpan(tracing.tracer().nextSpan());
}
代码示例来源:origin: openzipkin/brave
/**
* This exposes the microsecond clock used by operations such as {@link Span#finish()}. This is
* helpful when you want to time things manually. Notably, this clock will be coherent for all
* child spans in this trace (that use this tracing component). For example, NTP or system clock
* changes will not affect the result.
*
* @param context references a potentially unstarted span you'd like a clock correlated with
*/
public final Clock clock(TraceContext context) {
return tracer().pendingSpans.getOrCreate(context, false).clock();
}
代码示例来源:origin: line/armeria
/**
* Creates a new instance.
*/
protected HttpTracingClient(Client<HttpRequest, HttpResponse> delegate, Tracing tracing,
@Nullable String remoteServiceName) {
super(delegate);
tracer = tracing.tracer();
injector = tracing.propagationFactory().create(AsciiStringKeyFactory.INSTANCE)
.injector(HttpHeaders::set);
this.remoteServiceName = remoteServiceName;
}
代码示例来源:origin: line/armeria
/**
* Creates a new instance.
*/
public HttpTracingService(Service<HttpRequest, HttpResponse> delegate, Tracing tracing) {
super(delegate);
tracer = tracing.tracer();
extractor = tracing.propagationFactory().create(AsciiStringKeyFactory.INSTANCE)
.extractor(HttpHeaders::get);
}
代码示例来源:origin: lettuce-io/lettuce-core
@Override
public Span nextSpan(TraceContext traceContext) {
if (!(traceContext instanceof BraveTraceContext)) {
return nextSpan();
}
BraveTraceContext braveTraceContext = BraveTraceContext.class.cast(traceContext);
if (braveTraceContext.traceContext == null) {
return nextSpan();
}
return postProcessSpan(tracing.tracer()
.nextSpan(TraceContextOrSamplingFlags.create(braveTraceContext.traceContext)));
}
代码示例来源:origin: openzipkin/brave
@Inject TracingClientFilter(HttpTracing httpTracing) {
if (httpTracing == null) throw new NullPointerException("HttpTracing == null");
tracer = httpTracing.tracing().tracer();
handler = HttpClientHandler.create(httpTracing, new HttpAdapter());
injector = httpTracing.tracing().propagation().injector(SETTER);
}
代码示例来源:origin: openzipkin/brave
/**
* {@link ExtensionLoader} supplies the tracing implementation which must be named "tracing". For
* example, if using the {@link SpringExtensionFactory}, only a bean named "tracing" will be
* injected.
*/
public void setTracing(Tracing tracing) {
tracer = tracing.tracer();
extractor = tracing.propagation().extractor(GETTER);
injector = tracing.propagation().injector(SETTER);
}
代码示例来源:origin: openzipkin/brave
@Inject TracingApplicationEventListener(HttpTracing httpTracing, EventParser parser) {
tracer = httpTracing.tracing().tracer();
serverHandler = HttpServerHandler.create(httpTracing, new Adapter());
extractor = httpTracing.tracing().propagation().extractor(GETTER);
this.parser = parser;
}
代码示例来源:origin: openzipkin/brave
SparkTracing(HttpTracing httpTracing) { // intentionally hidden constructor
tracer = httpTracing.tracing().tracer();
handler = HttpServerHandler.create(httpTracing, ADAPTER);
extractor = httpTracing.tracing().propagation().extractor(Request::headers);
}
代码示例来源:origin: openzipkin/brave
HttpServerHandler(HttpTracing httpTracing, HttpServerAdapter<Req, Resp> adapter) {
super(
httpTracing.tracing().currentTraceContext(),
adapter,
httpTracing.serverParser()
);
this.tracer = httpTracing.tracing().tracer();
this.sampler = httpTracing.serverSampler();
}
代码示例来源:origin: openzipkin/brave
TracingMainExec(HttpTracing httpTracing, ClientExecChain mainExec) {
this.tracer = httpTracing.tracing().tracer();
this.handler = HttpClientHandler.create(httpTracing, new HttpAdapter());
this.injector = httpTracing.tracing().propagation().injector(SETTER);
this.mainExec = mainExec;
}
代码示例来源:origin: openzipkin/brave
TracingFilter(HttpTracing httpTracing) {
tracer = httpTracing.tracing().tracer();
currentTraceContext = httpTracing.tracing().currentTraceContext();
handler = HttpServerHandler.create(httpTracing, ADAPTER);
extractor = httpTracing.tracing().propagation().extractor(GETTER);
}
内容来源于网络,如有侵权,请联系作者删除!