GRPC instrumentation. Added new attributes according to the OpenTelemetry rpc convention#3127
Merged
vmarchaud merged 5 commits intoopen-telemetry:mainfrom Jul 30, 2022
Conversation
2 tasks
Member
|
Title isn't very specific as to what is actually happening. Please make a more descriptive title (and add it to changelog) |
Codecov Report
@@ Coverage Diff @@
## main #3127 +/- ##
==========================================
- Coverage 93.10% 93.09% -0.01%
==========================================
Files 195 196 +1
Lines 6384 6391 +7
Branches 1348 1348
==========================================
+ Hits 5944 5950 +6
- Misses 440 441 +1
|
dyladan
reviewed
Jul 29, 2022
experimental/packages/opentelemetry-instrumentation-grpc/src/enums/AttributeNames.ts
Show resolved
Hide resolved
experimental/packages/opentelemetry-instrumentation-grpc/src/enums/AttributeValues.ts
Show resolved
Hide resolved
dyladan
approved these changes
Jul 29, 2022
vmarchaud
approved these changes
Jul 30, 2022
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.
This PR is extending old one. Feel free to check it if needs comments
Which problem is this PR solving?
Opentelemtry grpc instrumentation is not consistent in terms of creating grpc attributes in requests.
For example in Java/Python instrumentations it contains necessary attributes for grpc connection:
But these attributes are missed in js grpc instrumentation. It doesn't set attributes.
Additionally, if compare Python/Java and Nodejs attributes.
Already existing attribute
rpc.methodis implemented incorrectly in Nodejs.opentelemetry-js/experimental/packages/opentelemetry-instrumentation-grpc/src/grpc-js/clientUtils.ts
Line 131 in 747c404
Fixes # (issue)
Short description of the changes
rpc.methodfromgrpc.methodtorpc.methodattribute (Client, Server)rpc.serviceattribute (Client, Server)rpc.systemattribute (Client, Server)rpc.methodvalue calculating for some use case. (it should be method, but value is just full path)Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Create GRPC example, run opentelemetry SDK using authoinstrumentation, or manually set
new GrpcInstrumentation(), you will see that Grpc instrumentation detects grpc connection and creates spans but with missing attributes:And for client rpc.method has incorrect value.
opentelemetry-js/experimental/packages/opentelemetry-instrumentation-grpc/src/grpc-js/clientUtils.ts
Line 131 in 747c404
Before:

Client/server
After:

Client/Server