Add the Nacos-Client 2.x plugin#18758
Open
peachisai wants to merge 23 commits into
Open
Conversation
|
|
Contributor
There was a problem hiding this comment.
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_conventionsentries. Existing RPC modules such asinstrumentation/grpc-1.6/metadata.yaml:3-7andinstrumentation/apache-dubbo-2.7/metadata.yaml:5-9declare 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 { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#18290
nacos-clientutilizes the Maven Shade plugin to prevent class conflicts. Consequently, gRPC instrumentation is unable to capture the requests.