Skip to content
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

HTTP link "fetcher strategy" circumvents common monitoring techniques #7832

Closed
bripkens opened this issue Mar 12, 2021 · 3 comments · Fixed by #8603
Closed

HTTP link "fetcher strategy" circumvents common monitoring techniques #7832

bripkens opened this issue Mar 12, 2021 · 3 comments · Fixed by #8603

Comments

@bripkens
Copy link

bripkens commented Mar 12, 2021

Disclaimer:
I am working for Instana, an monitoring/application-performance management company. I am opening this bug ticket as a result of several issues our customers are raising with us due to the HTTP link implementation. The intention is an upstream fix so that our customers, but also the customers of our competition, encounter fewer pitfalls when leveraging our solutions in combination with Apollo's HTTP link for an overall better end-user experience.

Intended outcome:
HTTP calls executed via HTTP link should be reliably monitored by application-performance management solutions, e.g. Instana, Speedcurve, New Relic…

Actual outcome:
HTTP calls cannot be reliably monitored. Only when the monitoring solution gets executed before the HTTP link gets created, monitoring works reliably. This happens because window.fetch is assigned to a local variable during the HTTP link creation. This in turn means that instrumentations of window.fetch by monitoring solutions may (not) be able to monitor window.fetch usages of Apollo HTTP link (loading order dependence is introduced).

Proposed solution:
Implement the fallback to window.fetch when making HTTP calls and not when creating the HTTP link, e.g. (fetcher || fetch)!(chosenURI, options).

How to reproduce the issue:
Overwrite window.fetch after Apollo HTTP link is loaded and notice that Apollo HTTP link will not leverage this updated window.fetch value.

Versions
Latest

@assertnotnull
Copy link

I also believe this problem is causing monitoring problems with https://github.com/DataDog/browser-sdk/tree/main/packages/rum and impedes us to see actions linked to backend logs and traces.

@mlevkovsky
Copy link

any update on this? We want to be able to instrument our frontend and backend applications, but this seems to be a hard blocker

@benjamn
Copy link
Member

benjamn commented Aug 6, 2021

@bripkens @mlevkovsky @assertnotnull Fix incoming: #8603. Will that PR enable your instrumentation use cases?

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
4 participants