本文整理汇总了Java中org.springframework.cloud.sleuth.SpanInjector类的典型用法代码示例。如果您正苦于以下问题:Java SpanInjector类的具体用法?Java SpanInjector怎么用?Java SpanInjector使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SpanInjector类属于org.springframework.cloud.sleuth包,在下文中一共展示了SpanInjector类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: invoke
import org.springframework.cloud.sleuth.SpanInjector; //导入依赖的package包/类
public Result invoke(Invoker<?> invoker, Invocation invocation) throws RpcException {
boolean isTraceDubbo = false;
Tracer tracer = null;
SpanInjector spanInjector = null;
try {
tracer = ApplicationContextAwareBean.CONTEXT.getBean(Tracer.class);
spanInjector = ApplicationContextAwareBean.CONTEXT.getBean(DubboSpanInjector.class);
isTraceDubbo = (tracer != null && spanInjector != null);
if (isTraceDubbo) {
String spanName = invoker.getUrl().getParameter("interface") + ":" + invocation.getMethodName() + ":" + invoker.getUrl().getParameter("version") + "(" + invoker.getUrl().getHost() + ")";
Span newSpan = tracer.createSpan(spanName);
spanInjector.inject(newSpan, RpcContext.getContext());
newSpan.logEvent(Span.CLIENT_SEND);
}
Result result = invoker.invoke(invocation);
return result;
} finally {
if (isTraceDubbo) {
if (tracer.isTracing()) {
tracer.getCurrentSpan().logEvent(Span.CLIENT_RECV);
tracer.close(tracer.getCurrentSpan());
}
}
}
}
开发者ID:threeq,项目名称:dubbo-zipkin,代码行数:30,代码来源:ConsumerSpanFilter.java
示例2: traceWebFilter
import org.springframework.cloud.sleuth.SpanInjector; //导入依赖的package包/类
@Bean
public FilterRegistrationBean traceWebFilter(Tracer tracer, TraceKeys traceKeys,
SkipPatternProvider skipPatternProvider, SpanReporter spanReporter,
SpanExtractor<HttpServletRequest> spanExtractor,
SpanInjector<HttpServletResponse> spanInjector,
HttpTraceKeysInjector httpTraceKeysInjector, TraceFilter traceFilter) {
FilterRegistrationBean filterRegistrationBean = new FilterRegistrationBean(traceFilter);
filterRegistrationBean.setDispatcherTypes(ASYNC, ERROR, FORWARD, INCLUDE, REQUEST);
return filterRegistrationBean;
}
开发者ID:reshmik,项目名称:Zipkin,代码行数:11,代码来源:TraceWebAutoConfiguration.java
示例3: traceFilter
import org.springframework.cloud.sleuth.SpanInjector; //导入依赖的package包/类
@Bean
public TraceFilter traceFilter(Tracer tracer, TraceKeys traceKeys,
SkipPatternProvider skipPatternProvider, SpanReporter spanReporter,
SpanExtractor<HttpServletRequest> spanExtractor,
SpanInjector<HttpServletResponse> spanInjector,
HttpTraceKeysInjector httpTraceKeysInjector) {
return new TraceFilter(tracer, traceKeys, skipPatternProvider.skipPattern(),
spanReporter, spanExtractor, spanInjector, httpTraceKeysInjector);
}
开发者ID:reshmik,项目名称:Zipkin,代码行数:10,代码来源:TraceWebAutoConfiguration.java
示例4: traceRestTemplateInterceptor
import org.springframework.cloud.sleuth.SpanInjector; //导入依赖的package包/类
@Bean
@ConditionalOnMissingBean
public TraceRestTemplateInterceptor traceRestTemplateInterceptor(Tracer tracer,
SpanInjector<HttpRequest> spanInjector,
HttpTraceKeysInjector httpTraceKeysInjector) {
return new TraceRestTemplateInterceptor(tracer, spanInjector, httpTraceKeysInjector);
}
开发者ID:reshmik,项目名称:Zipkin,代码行数:8,代码来源:TraceWebClientAutoConfiguration.java
示例5: TraceAsyncClientHttpRequestFactoryWrapper
import org.springframework.cloud.sleuth.SpanInjector; //导入依赖的package包/类
/**
* According to the JavaDocs all Spring {@link AsyncClientHttpRequestFactory} implement
* the {@link ClientHttpRequestFactory} interface.
*
* In case that it's not true we're setting the {@link SimpleClientHttpRequestFactory}
* as a default for sync request processing.
*
* @see org.springframework.web.client.AsyncRestTemplate#AsyncRestTemplate(AsyncClientHttpRequestFactory)
*/
public TraceAsyncClientHttpRequestFactoryWrapper(Tracer tracer,
SpanInjector<HttpRequest> spanInjector,
AsyncClientHttpRequestFactory asyncDelegate,
HttpTraceKeysInjector httpTraceKeysInjector) {
super(tracer, spanInjector, httpTraceKeysInjector);
this.asyncDelegate = asyncDelegate;
this.syncDelegate = asyncDelegate instanceof ClientHttpRequestFactory ?
(ClientHttpRequestFactory) asyncDelegate : defaultClientHttpRequestFactory();
}
开发者ID:reshmik,项目名称:Zipkin,代码行数:19,代码来源:TraceAsyncClientHttpRequestFactoryWrapper.java
示例6: TraceFilter
import org.springframework.cloud.sleuth.SpanInjector; //导入依赖的package包/类
public TraceFilter(Tracer tracer, TraceKeys traceKeys, SpanReporter spanReporter,
SpanExtractor<HttpServletRequest> spanExtractor,
SpanInjector<HttpServletResponse> spanInjector,
HttpTraceKeysInjector httpTraceKeysInjector) {
this(tracer, traceKeys, Pattern.compile(DEFAULT_SKIP_PATTERN), spanReporter,
spanExtractor, spanInjector, httpTraceKeysInjector);
}
开发者ID:reshmik,项目名称:Zipkin,代码行数:8,代码来源:TraceFilter.java
示例7: TraceRestClientRibbonCommandFactory
import org.springframework.cloud.sleuth.SpanInjector; //导入依赖的package包/类
public TraceRestClientRibbonCommandFactory(SpringClientFactory clientFactory,
Tracer tracer, SpanInjector<HttpRequest.Builder> spanInjector,
HttpTraceKeysInjector httpTraceKeysInjector) {
super(clientFactory);
this.tracer = tracer;
this.spanInjector = spanInjector;
this.httpTraceKeysInjector = httpTraceKeysInjector;
}
开发者ID:reshmik,项目名称:Zipkin,代码行数:9,代码来源:TraceRestClientRibbonCommandFactory.java
示例8: TraceRestClientRibbonCommand
import org.springframework.cloud.sleuth.SpanInjector; //导入依赖的package包/类
@SuppressWarnings("deprecation")
public TraceRestClientRibbonCommand(String commandKey, RestClient restClient,
HttpRequest.Verb verb, String uri, Boolean retryable,
MultiValueMap<String, String> headers,
MultiValueMap<String, String> params, InputStream requestEntity,
Tracer tracer, SpanInjector<HttpRequest.Builder> spanInjector,
HttpTraceKeysInjector httpTraceKeysInjector)
throws URISyntaxException {
super(commandKey, restClient, verb, uri, retryable, headers, params,
requestEntity);
this.tracer = tracer;
this.spanInjector = spanInjector;
this.httpTraceKeysInjector = httpTraceKeysInjector;
}
开发者ID:reshmik,项目名称:Zipkin,代码行数:15,代码来源:TraceRestClientRibbonCommandFactory.java
示例9: AbstractTraceChannelInterceptor
import org.springframework.cloud.sleuth.SpanInjector; //导入依赖的package包/类
protected AbstractTraceChannelInterceptor(Tracer tracer, TraceKeys traceKeys,
SpanExtractor<Message<?>> spanExtractor,
SpanInjector<MessageBuilder<?>> spanInjector) {
this.tracer = tracer;
this.traceKeys = traceKeys;
this.spanExtractor = spanExtractor;
this.spanInjector = spanInjector;
}
开发者ID:reshmik,项目名称:Zipkin,代码行数:9,代码来源:AbstractTraceChannelInterceptor.java
示例10: traceChannelInterceptor
import org.springframework.cloud.sleuth.SpanInjector; //导入依赖的package包/类
@Bean
@GlobalChannelInterceptor
public TraceChannelInterceptor traceChannelInterceptor(Tracer tracer,
TraceKeys traceKeys, Random random, SpanExtractor<Message<?>> spanExtractor,
SpanInjector<MessageBuilder<?>> spanInjector) {
return new IntegrationTraceChannelInterceptor(tracer, traceKeys, spanExtractor,
spanInjector);
}
开发者ID:reshmik,项目名称:Zipkin,代码行数:9,代码来源:TraceSpringIntegrationAutoConfiguration.java
示例11: dubboSpanInjector
import org.springframework.cloud.sleuth.SpanInjector; //导入依赖的package包/类
@Bean
public SpanInjector<RpcContext> dubboSpanInjector() {
Logger logger = Logger.getLogger(TraceDubboAutoConfiguration.class.getCanonicalName());
logger.info("生成dubbo span跟踪支持");
return new DubboSpanInjector();
}
开发者ID:threeq,项目名称:dubbo-zipkin,代码行数:7,代码来源:TraceDubboAutoConfiguration.java
示例12: HttpResponseInjectingTraceFilter
import org.springframework.cloud.sleuth.SpanInjector; //导入依赖的package包/类
public HttpResponseInjectingTraceFilter(Tracer tracer,
SpanInjector<HttpServletResponse> spanInjector) {
this.tracer = tracer;
this.spanInjector = spanInjector;
}
开发者ID:junneyang,项目名称:xxproject,代码行数:6,代码来源:Application.java
示例13: customHttpServletResponseSpanInjector
import org.springframework.cloud.sleuth.SpanInjector; //导入依赖的package包/类
@Bean
SpanInjector<HttpServletResponse> customHttpServletResponseSpanInjector() {
return new CustomHttpServletResponseSpanInjector();
}
开发者ID:junneyang,项目名称:xxproject,代码行数:5,代码来源:Application.java
示例14: httpServletResponseSpanInjector
import org.springframework.cloud.sleuth.SpanInjector; //导入依赖的package包/类
@Bean
public SpanInjector<HttpServletResponse> httpServletResponseSpanInjector() {
return new HttpServletResponseInjector();
}
开发者ID:reshmik,项目名称:Zipkin,代码行数:5,代码来源:TraceWebAutoConfiguration.java
示例15: AbstractTraceHttpRequestInterceptor
import org.springframework.cloud.sleuth.SpanInjector; //导入依赖的package包/类
protected AbstractTraceHttpRequestInterceptor(Tracer tracer,
SpanInjector<HttpRequest> spanInjector, HttpTraceKeysInjector keysInjector) {
this.tracer = tracer;
this.spanInjector = spanInjector;
this.keysInjector = keysInjector;
}
开发者ID:reshmik,项目名称:Zipkin,代码行数:7,代码来源:AbstractTraceHttpRequestInterceptor.java
示例16: TraceRestTemplateInterceptor
import org.springframework.cloud.sleuth.SpanInjector; //导入依赖的package包/类
public TraceRestTemplateInterceptor(Tracer tracer, SpanInjector<HttpRequest> spanInjector,
HttpTraceKeysInjector httpTraceKeysInjector) {
super(tracer, spanInjector, httpTraceKeysInjector);
}
开发者ID:reshmik,项目名称:Zipkin,代码行数:5,代码来源:TraceRestTemplateInterceptor.java
示例17: httpRequestSpanInjector
import org.springframework.cloud.sleuth.SpanInjector; //导入依赖的package包/类
@Bean
public SpanInjector<HttpRequest> httpRequestSpanInjector() {
return new HttpRequestInjector();
}
开发者ID:reshmik,项目名称:Zipkin,代码行数:5,代码来源:TraceWebClientAutoConfiguration.java
示例18: TraceFeignRequestInterceptor
import org.springframework.cloud.sleuth.SpanInjector; //导入依赖的package包/类
TraceFeignRequestInterceptor(Tracer tracer,
SpanInjector<RequestTemplate> spanInjector) {
this.tracer = tracer;
this.spanInjector = spanInjector;
}
开发者ID:reshmik,项目名称:Zipkin,代码行数:6,代码来源:TraceFeignRequestInterceptor.java
示例19: feignRequestTemplateInjector
import org.springframework.cloud.sleuth.SpanInjector; //导入依赖的package包/类
private SpanInjector<RequestTemplate> feignRequestTemplateInjector() {
return new FeignRequestTemplateInjector();
}
开发者ID:reshmik,项目名称:Zipkin,代码行数:4,代码来源:TraceFeignClientAutoConfiguration.java
示例20: feignResponseHeadersInjector
import org.springframework.cloud.sleuth.SpanInjector; //导入依赖的package包/类
private SpanInjector<FeignResponseHeadersHolder> feignResponseHeadersInjector() {
return new FeignResponseHeadersInjector();
}
开发者ID:reshmik,项目名称:Zipkin,代码行数:4,代码来源:TraceFeignClientAutoConfiguration.java
注:本文中的org.springframework.cloud.sleuth.SpanInjector类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论