-
Notifications
You must be signed in to change notification settings - Fork 96
Conversation
Hey @whs thanks for the first PR! :) Looking a bit further, I’m not sure including the You mention that the ideal would be to add it to the http plugin directly, and I think we can actually do that with minimal effects and no interface breaking. I’d suggest we do the following:
Generally, I think it's better to keep instrumentation-specific configurations localized to the instrumentation library as much as possible. Things will only get more confusing when we add more instrumentation. What do you think about that? If you need help with anything don’t hesitate to ask. @fabiogomessilva Adding you just in case you had different intentions for this config option. /cc @isaikevych |
I just got back from re:invent to start working on this. I'm not sure how to pass a configuration object to the instrumenter.
At this point I'd suggest these changes:
Should be mostly compatible with existing code. |
Yeah, my thought was to have the user write a new module that would pass the config to the plugin implementation, but I like your idea much better. It's also backward compatible, which is great. (As long as the plugin can handle an I think that's the way to go, and having a way to send configuration to the plugins would be a great feature! Would you have time to implement this? Or would you need some help on some of it? |
Done! New version should be working even better than the original one. |
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.
Awesome! Thanks @whs! :)
I have a couple code comments to look at.
Also, the https
and http2
plugins extend from http
, so we should verify that they also work with the new config options for the http module. I'm a little worried they won't, but we should update those tests to include the same checks you added in the test-http.ts
and we'll know for sure. I don't think it would be much more work to move the same logic from http
into https
and http2
.
packages/opencensus-nodejs/src/trace/instrumentation/plugin-loader.ts
Outdated
Show resolved
Hide resolved
I'm having problem with http2. It seems that the original URL is not recorded in the session object, yet our interface requires the full URI for outgoing requests. I'm thinking of leaving http2 unsupported for now. |
I think that's fine for now as long as we document it. This is more of an advanced feature, so having some corner-cases is going to be expected. |
@whs I think the failing tests are just code style problems. You should be able to run |
Codecov Report
@@ Coverage Diff @@
## master #160 +/- ##
==========================================
+ Coverage 94.57% 94.61% +0.03%
==========================================
Files 101 101
Lines 7242 7311 +69
Branches 681 690 +9
==========================================
+ Hits 6849 6917 +68
- Misses 393 394 +1
Continue to review full report at Codecov.
|
Merged master and test passed for Stackdriver. Anything else blocking the merge? |
Thanks @whs! This looks good. One last thing... can you update the CHANGELOG.md file and add a new bullet under the Unreleased section? That should be the last thing and then I can merge this in! You can use the following:
|
Added! |
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! Thanks @whs for adding this!
This add ignoreUrls support by adding a check to CoreTracer.
Ideally, I would add it to the HTTP tracer directly but that would 1) requires interface change to pass the configuration to instrumenters and 2) it would requires modifying all tracers to honer the flag.
I'm not sure what's the intention of the interface's designer here, so I decided to go with the path of least resistance.