-
Notifications
You must be signed in to change notification settings - Fork 534
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add gRPC Census propagator #39
Conversation
Signed-off-by: Kelly, Niall <[email protected]>
Signed-off-by: Kelly, Niall <[email protected]>
propagators/opentelemetry-propagator-grpc-census-binary/package.json
Outdated
Show resolved
Hide resolved
Signed-off-by: Kelly, Niall <[email protected]>
I signed it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Welcome to OpenTelemetry Community!
Added first pass comments, did you get a chance to verify this propagator in sample example or somewhere else?
@@ -0,0 +1,69 @@ | |||
{ | |||
"name": "@opentelemetry/propagator-grpc-census-binary", | |||
"version": "0.0.2", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/0.0.2/0.7.0
: this is the current ongoing version of contrib packages (generally, we tried to keep versions in the sync).
"tslint-consistent-codestyle": "^1.16.0", | ||
"tslint-microsoft-contrib": "^6.2.0", | ||
"typescript": "3.7.2", | ||
"webpack": "^4.35.2" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is unused dependency.
"@types/mocha": "^7.0.0", | ||
"@types/node": "^12.6.8", | ||
"@types/sinon": "^7.0.13", | ||
"@types/webpack-env": "1.13.9", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here.
"devDependencies": { | ||
"@types/mocha": "^7.0.0", | ||
"@types/node": "^12.6.8", | ||
"@types/sinon": "^7.0.13", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here.
"codecov": "^3.6.1", | ||
"grpc": "^1.24.2", | ||
"gts": "^1.1.0", | ||
"istanbul-instrumenter-loader": "^3.0.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here.
propagators/opentelemetry-propagator-grpc-census-binary/src/BinaryTraceContext.ts
Show resolved
Hide resolved
* limitations under the License. | ||
*/ | ||
|
||
// This file is the webpack entry point for the browser Karma tests. It requires |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This propagator is not applicable for browser, please remove this file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @mayurkale22. I will address your comments tomorrow.
Yes, I did verify this propagator (both inbound and outbound gRPC, from/to services instrumented with OpenCensus) as part of the fork of microservices-demo mentioned in the description.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Latest commit should hopefully cover your first pass @mayurkale22. (FYI, next "I signed it" comment is related to CLA for CNCF).
Signed-off-by: Kelly, Niall <[email protected]>
I signed it |
/check-cla |
@WillsonHG I believe @nkelly75 needs to be the one to comment to get the cla rechecked |
/check-cla |
I signed it |
propagators/opentelemetry-propagator-grpc-census-binary/src/BinaryTraceContext.ts
Show resolved
Hide resolved
propagators/opentelemetry-propagator-grpc-census-binary/src/GrpcCensusPropagator.ts
Show resolved
Hide resolved
Signed-off-by: Kelly, Niall <[email protected]>
* | ||
* @param context - Context to be injected | ||
* @param carrier - Carrier in which to inject (for gRPC this will | ||
* be a grpc.Metadata object) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest to add 4 spaces to show the continuation of previous comment.
* @param carrier - Carrier in which to inject (for gRPC this will | ||
* be a grpc.Metadata object) | ||
* @param setter - setter function that sets the correct key in | ||
* the carrier |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here.
propagators/opentelemetry-propagator-grpc-census-binary/package.json
Outdated
Show resolved
Hide resolved
Signed-off-by: Kelly, Niall <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #39 +/- ##
==========================================
+ Coverage 94.32% 94.47% +0.15%
==========================================
Files 57 62 +5
Lines 3294 3494 +200
Branches 351 376 +25
==========================================
+ Hits 3107 3301 +194
- Misses 187 193 +6
|
Signed-off-by: Kelly, Niall <[email protected]>
Signed-off-by: Kelly, Niall <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me
Signed-off-by: Kelly, Niall <[email protected]>
@mayurkale22 if you're ok with it, I'll release just this package when it merges as 0.8.0 and make an addendum to the changelog noting that this was released. |
Sounds good to me. Let's do that. |
Signed-off-by: Kelly, Niall [email protected]
Which problem is this PR solving?
Aims to address issue #35 i.e. creation of a binary gRPC census propagator. This is intended to provide interoperability with existing services that use gRPC and are instrumented with OpenCensus. I have tested this using a fork of the microservices-demo where most services were already instrumented using OpenCensus but I had modified one node service to use direct OpenTelemetry instrumentation.
Short description of the changes
The new propagator, GrpcCensusPropagator, implements the existing HttpTextPropagator interface allowing its inject/extract implementations to be called from the existing GrpcPlugin in @opentelemetry/plugin-grpc. The binary encoding/decoding actually happens in BinaryTraceContext.ts which is derived from previous work by @mayurkale22 (more details in README.md).
The commit includes unit tests with full coverage of the two main src files.
The new Propagator should compile, lint and test successfully e.g. using
lerna bootstrap
andlerna run test --scope @opentelemetry/propagator-grpc
.However, I encountered some issues elsewhere in the monorepo e.g.
packages/opentelemetry-test-utils
(which impacted unit tests elsewhere)I anticipate these may come up as part of the merge checks.