-
Notifications
You must be signed in to change notification settings - Fork 227
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(http): add monitorIncomingHTTPRequests config #1298
Conversation
76aaef6
to
8aa4344
Compare
Tip: You can use the new Draft PR feature of GitHub for WIP PR's 😃 |
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 so far...
I do think it might be easy to misunderstand what disableInstrumentations: ['http']
does with the introduction of monitorIncomingHTTPRequests
. A user could easily think that disableInstrumentations: ['http']
would disable both incoming and outgoing, while only monitorIncomingHTTPRequests: false
would disable only incoming. But I guess this is just a matter of proper documentation.
8ce0462
to
d6d7177
Compare
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.
It all looks good 💯
I think all we're missing now is:
- Docs
- Update TypeScript typings for the config options object (
AgentConfigOptions
) - And I'm just wondering if it would be worth it to add a test to see what happens if you set this new config option to
false
. For example where you then start an HTTP server which, when it gets an incoming HTTP request starts a manual transaction and make an outgoing HTTP request. The make a request to this HTTP server and check that it didn't try to create a transaction automatically but still created the manual transaction and a span for the outgoing request.
f673118
to
866836c
Compare
I've narrowed the 12.0 failure to |
The failure is due to the issue fixed by nodejs/node#27477, which didn't land until 12.2.0. As a result, all 12.x releases before 12.2.0 will actually have a context loss in the response handler of all outgoing requests. Apparently our existing tests just happened to not cover that particular case. 🤔 |
e993455
to
feae7bd
Compare
The PR description still says WIP, but I assume it's ready now? |
Yep, just forgot to update the description. 👍 |
The 'monitor' prefix was replaced by 'instrument' to better align with other config names.
The PR elastic#1298 introduced a bug in the tests as it expected the span.type for outgoing http requests to start with `ext.*`. This was changed to `external.*` in the PR elastic#1291, but elastic#1298 was just never updated to be up to date with master before it was merged.
PR for splitting disabling of outgoing http requests from incoming http requests.
Closes #434
Checklist