本文整理汇总了Java中org.springframework.cloud.sleuth.SpanReporter.report方法的典型用法代码示例。如果您正苦于以下问题:Java SpanReporter.report方法的具体用法?Java SpanReporter.report怎么用?Java SpanReporter.report使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.springframework.cloud.sleuth.SpanReporter
的用法示例。
在下文中一共展示了SpanReporter.report方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: defaultsToV2Endpoint
import org.springframework.cloud.sleuth.SpanReporter; //导入方法依赖的package包/类
@Test
public void defaultsToV2Endpoint() throws Exception {
context = new AnnotationConfigApplicationContext();
addEnvironment(context, "spring.zipkin.base-url:" + server.url("/"));
context.register(
PropertyPlaceholderAutoConfiguration.class,
TraceMetricsAutoConfiguration.class,
ZipkinAutoConfiguration.class);
context.refresh();
SpanReporter spanReporter = context.getBean(SpanReporter.class);
spanReporter.report(span);
Awaitility.await().untilAsserted(() -> then(server.getRequestCount()).isGreaterThan(0));
RecordedRequest request = server.takeRequest();
then(request.getPath()).isEqualTo("/api/v2/spans");
then(request.getBody().readUtf8()).contains("localEndpoint");
}
示例2: encoderDirectsEndpoint
import org.springframework.cloud.sleuth.SpanReporter; //导入方法依赖的package包/类
@Test
public void encoderDirectsEndpoint() throws Exception {
context = new AnnotationConfigApplicationContext();
addEnvironment(
context, "spring.zipkin.base-url:" + server.url("/"), "spring.zipkin.encoder:JSON_V1");
context.register(
PropertyPlaceholderAutoConfiguration.class,
TraceMetricsAutoConfiguration.class,
ZipkinAutoConfiguration.class);
context.refresh();
SpanReporter spanReporter = context.getBean(SpanReporter.class);
spanReporter.report(span);
Awaitility.await().untilAsserted(() -> then(server.getRequestCount()).isGreaterThan(0));
RecordedRequest request = server.takeRequest();
then(request.getPath()).isEqualTo("/api/v1/spans");
then(request.getBody().readUtf8()).contains("binaryAnnotations");
}
示例3: logServerSent
import org.springframework.cloud.sleuth.SpanReporter; //导入方法依赖的package包/类
void logServerSent(SpanReporter spanReporter, Span parent) {
if (parent != null && parent.isRemote()) {
parent.logEvent(Span.SERVER_SEND);
spanReporter.report(parent);
}
}