brave.Tracing.propagationFactory()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(2.7k)|赞(0)|评价(0)|浏览(89)

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

Tracing.propagationFactory介绍

[英]This supports edge cases like GRPC Metadata propagation which doesn't use String keys.
[中]这支持边缘情况,比如不使用字符串键的GRPC元数据传播。

代码示例

代码示例来源:origin: openzipkin/brave

/**
 * When a trace leaves the process, it needs to be propagated, usually via headers. This utility
 * is used to inject or extract a trace context from remote requests.
 */
// Implementations should override and cache this as a field.
public Propagation<String> propagation() {
 return propagationFactory().create(Propagation.KeyFactory.STRING);
}

代码示例来源:origin: openzipkin/brave

GrpcTracing(Builder builder) { // intentionally hidden constructor
 tracing = builder.tracing;
 grpcPropagationFormatEnabled = builder.grpcPropagationFormatEnabled;
 Propagation.Factory propagationFactory = tracing.propagationFactory();
 if (grpcPropagationFormatEnabled) {
  propagationFactory = GrpcPropagation.newFactory(propagationFactory);
 }
 propagation = propagationFactory.create(AsciiMetadataKeyFactory.INSTANCE);
 clientParser = builder.clientParser;
 serverParser = builder.serverParser;
}

代码示例来源: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: io.zipkin.brave/brave

/**
 * When a trace leaves the process, it needs to be propagated, usually via headers. This utility
 * is used to inject or extract a trace context from remote requests.
 */
// Implementations should override and cache this as a field.
public Propagation<String> propagation() {
 return propagationFactory().create(Propagation.KeyFactory.STRING);
}

代码示例来源:origin: io.zipkin.brave/brave-instrumentation-grpc

GrpcTracing(Builder builder) { // intentionally hidden constructor
 tracing = builder.tracing;
 grpcPropagationFormatEnabled = builder.grpcPropagationFormatEnabled;
 Propagation.Factory propagationFactory = tracing.propagationFactory();
 if (grpcPropagationFormatEnabled) {
  propagationFactory = GrpcPropagation.newFactory(propagationFactory);
 }
 propagation = propagationFactory.create(AsciiMetadataKeyFactory.INSTANCE);
 clientParser = builder.clientParser;
 serverParser = builder.serverParser;
}

相关文章