io.opencensus.trace.Tracing.getPropagationComponent()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(6.0k)|赞(0)|评价(0)|浏览(153)

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

Tracing.getPropagationComponent介绍

[英]Returns the global PropagationComponent.
[中]返回全局传播组件。

代码示例

代码示例来源:origin: census-instrumentation/opencensus-java

/**
 * Default constructor construct new instance with {@link JaxrsContainerExtractor}, {@link
 * io.opencensus.trace.propagation.PropagationComponent#getTraceContextFormat()} and as public
 * endpoint.
 *
 * @see #JaxrsContainerFilter(HttpExtractor, TextFormat, Boolean)
 */
public JaxrsContainerFilter() {
 this(
   new JaxrsContainerExtractor(),
   Tracing.getPropagationComponent().getTraceContextFormat(),
   /* publicEndpoint= */ true);
}

代码示例来源:origin: census-instrumentation/opencensus-java

/** Constructs new client filter with default configuration. */
public JaxrsClientFilter() {
 this(new JaxrsClientExtractor(), Tracing.getPropagationComponent().getTraceContextFormat());
}

代码示例来源:origin: io.grpc/grpc-core

@VisibleForTesting
final List<? extends ServerStreamTracer.Factory> getTracerFactories() {
 ArrayList<ServerStreamTracer.Factory> tracerFactories = new ArrayList<>();
 if (statsEnabled) {
  CensusStatsModule censusStats = censusStatsOverride;
  if (censusStats == null) {
   censusStats = new CensusStatsModule(
     GrpcUtil.STOPWATCH_SUPPLIER, true, recordStartedRpcs, recordFinishedRpcs,
     recordRealTimeMetrics);
  }
  tracerFactories.add(censusStats.getServerTracerFactory());
 }
 if (tracingEnabled) {
  CensusTracingModule censusTracing =
    new CensusTracingModule(Tracing.getTracer(),
      Tracing.getPropagationComponent().getBinaryFormat());
  tracerFactories.add(censusTracing.getServerTracerFactory());
 }
 tracerFactories.addAll(streamTracerFactories);
 tracerFactories.trimToSize();
 return Collections.unmodifiableList(tracerFactories);
}

代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded

@VisibleForTesting
final List<ServerStreamTracer.Factory> getTracerFactories() {
 ArrayList<ServerStreamTracer.Factory> tracerFactories =
   new ArrayList<ServerStreamTracer.Factory>();
 if (statsEnabled) {
  CensusStatsModule censusStats = this.censusStatsOverride;
  if (censusStats == null) {
   censusStats = new CensusStatsModule(GrpcUtil.STOPWATCH_SUPPLIER, true);
  }
  tracerFactories.add(
    censusStats.getServerTracerFactory(recordStartedRpcs, recordFinishedRpcs));
 }
 if (tracingEnabled) {
  CensusTracingModule censusTracing =
    new CensusTracingModule(Tracing.getTracer(),
      Tracing.getPropagationComponent().getBinaryFormat());
  tracerFactories.add(censusTracing.getServerTracerFactory());
 }
 tracerFactories.addAll(streamTracerFactories);
 return tracerFactories;
}

代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded

@VisibleForTesting
final List<ClientInterceptor> getEffectiveInterceptors() {
 List<ClientInterceptor> effectiveInterceptors =
   new ArrayList<ClientInterceptor>(this.interceptors);
 if (statsEnabled) {
  retryDisabled = true;
  CensusStatsModule censusStats = this.censusStatsOverride;
  if (censusStats == null) {
   censusStats = new CensusStatsModule(GrpcUtil.STOPWATCH_SUPPLIER, true);
  }
  // First interceptor runs last (see ClientInterceptors.intercept()), so that no
  // other interceptor can override the tracer factory we set in CallOptions.
  effectiveInterceptors.add(
    0, censusStats.getClientInterceptor(recordStartedRpcs, recordFinishedRpcs));
 }
 if (tracingEnabled) {
  retryDisabled = true;
  CensusTracingModule censusTracing =
    new CensusTracingModule(Tracing.getTracer(),
      Tracing.getPropagationComponent().getBinaryFormat());
  effectiveInterceptors.add(0, censusTracing.getClientInterceptor());
 }
 return effectiveInterceptors;
}

代码示例来源:origin: census-instrumentation/opencensus-java

/** Create a new {@code OcJettyHttpClient}. */
public OcJettyHttpClient() {
 super();
 OcJettyHttpClientExtractor extractor = new OcJettyHttpClientExtractor();
 handler =
   new HttpClientHandler<Request, Response, Request>(
     Tracing.getTracer(),
     extractor,
     Tracing.getPropagationComponent().getTraceContextFormat(),
     setter);
}

代码示例来源:origin: io.grpc/grpc-core

@VisibleForTesting
final List<ClientInterceptor> getEffectiveInterceptors() {
 List<ClientInterceptor> effectiveInterceptors =
   new ArrayList<>(this.interceptors);
 temporarilyDisableRetry = false;
 if (statsEnabled) {
  temporarilyDisableRetry = true;
  CensusStatsModule censusStats = this.censusStatsOverride;
  if (censusStats == null) {
   censusStats = new CensusStatsModule(
     GrpcUtil.STOPWATCH_SUPPLIER, true, recordStartedRpcs, recordFinishedRpcs,
     recordRealTimeMetrics);
  }
  // First interceptor runs last (see ClientInterceptors.intercept()), so that no
  // other interceptor can override the tracer factory we set in CallOptions.
  effectiveInterceptors.add(0, censusStats.getClientInterceptor());
 }
 if (tracingEnabled) {
  temporarilyDisableRetry = true;
  CensusTracingModule censusTracing =
    new CensusTracingModule(Tracing.getTracer(),
      Tracing.getPropagationComponent().getBinaryFormat());
  effectiveInterceptors.add(0, censusTracing.getClientInterceptor());
 }
 return effectiveInterceptors;
}

代码示例来源:origin: census-instrumentation/opencensus-java

@Test
public void implementationOfBinaryPropagationHandler() {
 assertThat(Tracing.getPropagationComponent()).isInstanceOf(PropagationComponentImpl.class);
}

代码示例来源:origin: census-instrumentation/opencensus-java

@Test
public void implementationOfBinaryPropagationHandler() {
 assertThat(Tracing.getPropagationComponent()).isInstanceOf(PropagationComponent.class);
}

代码示例来源:origin: census-instrumentation/opencensus-java

static HttpServerHandler<HttpServletRequest, HttpServletResponse, HttpServletRequest>
  buildHttpServerHandler() {
 return new HttpServerHandler<HttpServletRequest, HttpServletResponse, HttpServletRequest>(
   Tracing.getTracer(),
   // TODO[rghetia]:
   // 1. provide options to configure custom extractor, propagator and endpoint.
   new OcHttpServletExtractor(),
   Tracing.getPropagationComponent().getTraceContextFormat(),
   getter,
   true);
}

代码示例来源:origin: census-instrumentation/opencensus-java

@Test
public void defaultBinaryPropagationHandler() {
 assertThat(Tracing.getPropagationComponent())
   .isSameAs(PropagationComponent.getNoopPropagationComponent());
}

相关文章