Skip to content

Add the Nacos-Client 2.x plugin#18758

Open
peachisai wants to merge 23 commits into
open-telemetry:mainfrom
peachisai:dev
Open

Add the Nacos-Client 2.x plugin#18758
peachisai wants to merge 23 commits into
open-telemetry:mainfrom
peachisai:dev

Conversation

@peachisai
Copy link
Copy Markdown

#18290
nacos-client utilizes the Maven Shade plugin to prevent class conflicts. Consequently, gRPC instrumentation is unable to capture the requests.

Copilot AI review requested due to automatic review settings May 15, 2026 00:47
@peachisai peachisai requested a review from a team as a code owner May 15, 2026 00:47
@linux-foundation-easycla
Copy link
Copy Markdown

linux-foundation-easycla Bot commented May 15, 2026

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: peachisai / name: peachisai (6226da8)

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 18 out of 18 changed files in this pull request and generated 15 comments.

Comments suppressed due to low confidence (2)

instrumentation/nacos-client-2.0/metadata.yaml:3

  • [Documentation] This module builds RPC client/consumer spans, but the metadata does not declare any semantic_conventions entries. Existing RPC modules such as instrumentation/grpc-1.6/metadata.yaml:3-7 and instrumentation/apache-dubbo-2.7/metadata.yaml:5-9 declare their RPC span/metric signals so generated docs and the instrumentation registry classify the emitted telemetry correctly.
description: This instrumentation provides a template for Nacos client 2.x spans.
disabled_by_default: true

instrumentation/nacos-client-2.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/nacosclient/v2_0/NacosClientInstrumentationModule.java:33

  • [General] The module is registered but explicitly disabled by default, while the PR/linked issue describe adding Nacos 2.x instrumentation to cover requests that shaded gRPC cannot capture. As written, users will still get no Nacos spans after upgrading unless they discover and set otel.instrumentation.nacos-client.enabled=true; either make the instrumentation enabled by default or document the opt-in rationale clearly.
  @Override
  public boolean defaultEnabled() {
    return false;
  }

@@ -0,0 +1,4 @@
display_name: Nacos Client
description: This instrumentation provides a template for Nacos client 2.x spans.
Comment on lines +24 to +27
return asList(
new GrpcClientInstrumentation(),
new GrpcConnectionInstrumentation(),
new RpcClientInstrumentation());
Comment on lines +91 to +92
.addAttributesExtractor(new NacosClientAttributesExtractor());
return builder.buildInstrumenter(SpanKindExtractor.alwaysConsumer());
import com.alibaba.nacos.api.remote.request.Request;
import javax.annotation.Nullable;

public final class NacosClientRequest {
import io.opentelemetry.context.Context;
import io.opentelemetry.context.Scope;

public final class ContextAndScope {
Comment on lines +15 to +16
final class NacosClientRpcAttributesGetter
implements RpcAttributesGetter<NacosClientRequest, Response> {
Comment on lines +13 to +15
final class NacosClientNetworkAttributesGetter
implements ServerAttributesGetter<NacosClientRequest>,
NetworkAttributesGetter<NacosClientRequest, Response> {
Comment on lines +25 to +26
final class NacosClientAttributesExtractor
implements AttributesExtractor<NacosClientRequest, Response> {
request, category, operation, peer, hostPort.host(), hostPort.port());
}

private static final class HostPort {
}
}

private static final class ServerCheckRequest extends Request {
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants