本文整理了Java中io.opencensus.exporter.trace.zipkin.ZipkinTraceExporter
类的一些代码示例,展示了ZipkinTraceExporter
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZipkinTraceExporter
类的具体详情如下:
包路径:io.opencensus.exporter.trace.zipkin.ZipkinTraceExporter
类名称:ZipkinTraceExporter
[英]An OpenCensus span exporter implementation which exports data to Zipkin.
Example of usage:
public static void main(String[] args) }
[中]将数据导出到Zipkin的OpenCensus span exporter实现。
用法示例:
public static void main(String[] args) }
代码示例来源:origin: census-instrumentation/opencensus-java
/**
* Registers the {@code ZipkinExporter}.
*
* @param spanExporter the instance of the {@code SpanExporter} where this service is registered.
*/
@VisibleForTesting
static void register(SpanExporter spanExporter, Handler handler) {
ZipkinTraceExporter.register(spanExporter, handler);
}
代码示例来源:origin: census-instrumentation/opencensus-java
/**
* Unregisters the Zipkin Trace exporter from the OpenCensus library.
*
* @throws IllegalStateException if a Zipkin exporter is not registered.
* @since 0.8
*/
public static void unregister() {
ZipkinTraceExporter.unregister();
}
代码示例来源:origin: census-instrumentation/opencensus-java
/**
* Creates and registers the Zipkin Trace exporter to the OpenCensus library. Only one Zipkin
* exporter can be registered at any point.
*
* @param v2Url Ex http://127.0.0.1:9411/api/v2/spans
* @param serviceName the {@link Span#localServiceName() local service name} of the process.
* @throws IllegalStateException if a Zipkin exporter is already registered.
* @since 0.8
*/
public static void createAndRegister(String v2Url, String serviceName) {
ZipkinTraceExporter.createAndRegister(v2Url, serviceName);
}
代码示例来源:origin: census-instrumentation/opencensus-java
@Test
public void registerUnregisterZipkinExporter() {
ZipkinTraceExporter.register(spanExporter, handler);
verify(spanExporter)
.registerHandler(
eq("io.opencensus.exporter.trace.zipkin.ZipkinTraceExporter"), same(handler));
ZipkinTraceExporter.unregister(spanExporter);
verify(spanExporter)
.unregisterHandler(eq("io.opencensus.exporter.trace.zipkin.ZipkinTraceExporter"));
}
}
代码示例来源:origin: census-instrumentation/opencensus-java
/**
* Unregisters the {@code ZipkinExporter}.
*
* @param spanExporter the instance of the {@code SpanExporter} from where this service is
* unregistered.
*/
@VisibleForTesting
static void unregister(SpanExporter spanExporter) {
ZipkinTraceExporter.unregister(spanExporter);
}
}
代码示例来源:origin: census-instrumentation/opencensus-java
/**
* Creates and registers the Zipkin Trace exporter to the OpenCensus library. Only one Zipkin
* exporter can be registered at any point.
*
* @param encoder Usually {@link SpanBytesEncoder#JSON_V2}
* @param sender Often, but not necessarily an http sender. This could be Kafka or SQS.
* @param serviceName the {@link Span#localServiceName() local service name} of the process.
* @throws IllegalStateException if a Zipkin exporter is already registered.
* @since 0.12
*/
public static void createAndRegister(
SpanBytesEncoder encoder, Sender sender, String serviceName) {
synchronized (monitor) {
checkState(handler == null, "Zipkin exporter is already registered.");
Handler newHandler = new ZipkinExporterHandler(encoder, sender, serviceName);
handler = newHandler;
register(Tracing.getExportComponent().getSpanExporter(), newHandler);
}
}
代码示例来源:origin: census-instrumentation/opencensus-java
/**
* Creates and registers the Zipkin Trace exporter to the OpenCensus library. Only one Zipkin
* exporter can be registered at any point.
*
* @param encoder Usually {@link SpanBytesEncoder#JSON_V2}
* @param sender Often, but not necessarily an http sender. This could be Kafka or SQS.
* @param serviceName the {@link Span#localServiceName() local service name} of the process.
* @throws IllegalStateException if a Zipkin exporter is already registered.
* @since 0.8
*/
public static void createAndRegister(
SpanBytesEncoder encoder, Sender sender, String serviceName) {
ZipkinTraceExporter.createAndRegister(encoder, sender, serviceName);
}
代码示例来源:origin: census-instrumentation/opencensus-java
/**
* Unregisters the Zipkin Trace exporter from the OpenCensus library.
*
* @throws IllegalStateException if a Zipkin exporter is not registered.
* @since 0.12
*/
public static void unregister() {
synchronized (monitor) {
checkState(handler != null, "Zipkin exporter is not registered.");
unregister(Tracing.getExportComponent().getSpanExporter());
handler = null;
}
}
代码示例来源:origin: census-instrumentation/opencensus-java
/**
* Creates and registers the Zipkin Trace exporter to the OpenCensus library. Only one Zipkin
* exporter can be registered at any point.
*
* @param v2Url Ex http://127.0.0.1:9411/api/v2/spans
* @param serviceName the {@link Span#localServiceName() local service name} of the process.
* @throws IllegalStateException if a Zipkin exporter is already registered.
* @since 0.12
*/
public static void createAndRegister(String v2Url, String serviceName) {
createAndRegister(SpanBytesEncoder.JSON_V2, URLConnectionSender.create(v2Url), serviceName);
}
内容来源于网络,如有侵权,请联系作者删除!