expose apm
instance from framework integrations
#799
Labels
Milestone
apm
instance from framework integrations
#799
@elastic/apm-rum
for the sole purpose of initialisation and avoid users from download duplicatedapm-rum
package if multiple packages are imported in different entry points.Solutions
This is a common problem and we have to deal with it There are couple of options.
1. Exposing
apmBase, apm
from@elastic/apm-rum-*
(react/angular/vue) packagesThis would let users to use to initialise the agent from the imports of a single package and would remove the need to import
@elastic/apm-rum
for initialisation purpose alone. This is already done inVuePlugin
andAngularService
butreact
package doesn't expose it.2. Relying on
window.elasticApm
in framework integrationsThis has huge disadvantages.
apmbase
before the framework package which would result inwindow.elasticApm
not being found if any of the modules was downloadedasync
and we cannot dynamically import if the package isn't found.Looking at both options, I would say No.1 is an easy solution and best approach.
The text was updated successfully, but these errors were encountered: