linghengqian commented on code in PR #37659:
URL: https://github.com/apache/shardingsphere/pull/37659#discussion_r2668203736
##########
agent/plugins/tracing/type/opentelemetry/src/main/java/org/apache/shardingsphere/agent/plugin/tracing/opentelemetry/advice/OpenTelemetryJDBCExecutorCallbackAdvice.java:
##########
@@ -42,7 +42,9 @@ protected void recordExecuteInfo(final Span parentSpan, final
TargetAdviceObject
final ConnectionProperties
connectionProps, final DatabaseType databaseType) {
Tracer tracer =
GlobalOpenTelemetry.getTracer(OpenTelemetryConstants.TRACER_NAME);
SpanBuilder spanBuilder = tracer.spanBuilder(OPERATION_NAME);
- spanBuilder.setParent(Context.current().with(parentSpan));
+ if (null != parentSpan) {
+ spanBuilder.setParent(Context.current().with(parentSpan));
+ }
Review Comment:
~This doesn't seem to be the point?~ Fixed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]