use of io.helidon.tracing.config.SpanTracingConfig in project helidon by oracle.
the class Response method createWriteSpan.
private Span createWriteSpan(GenericType<?> type) {
Optional<SpanContext> parentSpan = spanContext();
if (!parentSpan.isPresent()) {
// from request
return null;
}
SpanTracingConfig spanConfig = TracingConfigUtil.spanConfig(NettyWebServer.TRACING_COMPONENT, TRACING_CONTENT_WRITE);
if (spanConfig.enabled()) {
String spanName = spanConfig.newName().orElse(TRACING_CONTENT_WRITE);
Tracer.SpanBuilder spanBuilder = WebTracingConfig.tracer(webServer()).buildSpan(spanName).asChildOf(parentSpan.get());
if (type != null) {
spanBuilder.withTag("response.type", type.getTypeName());
}
return spanBuilder.start();
}
return null;
}
Aggregations