newrelic / newrelic-browser-agent

New Relic Browser Agent
Apache License 2.0
76 stars 40 forks source link

Micro Agent - Stop browser APP sending metricts #719

Open Khaos93 opened 12 months ago

Khaos93 commented 12 months ago

Hi

I want to know if is there a method or mechanism available to intentionally halt the browser agent from sending metricts to New Relic

workato-integration[bot] commented 12 months ago

https://issues.newrelic.com/browse/NR-162318

patrickhousley commented 12 months ago

Hi @Khaos93 can you elaborate more on what data you are not wanting to send and what your current installation/implementation of the browser agent looks like?

Khaos93 commented 12 months ago

Hi @patrickhousley

I have an application embedded within other client applications. The issue I'm encountering is that when the embedded app is unmounted within the parent application, the New Relic client continues to send metrics even though the initializing application is no longer active.

agent = new MicroAgent({ configuration }) agent.start

we are using the verion 1.238.0

patrickhousley commented 12 months ago

@Khaos93 I know this might be a tough ask but is there any way you could create a simple app to highlight this use-case for us? You can zip up the source and drop it here.

workato-integration[bot] commented 11 months ago

https://new-relic.atlassian.net/browse/NR-162318

FranciscoKloganB commented 6 months ago

An explicit stop feature is also desired by us in the browser agent.

We are allowing the user to opt-in to instrumentation and session replay.

We explicit call the start on the after he opts-in and we would like to call stop if he opts out. Currently, our work around is to start with a minimum set of autoStart: true features, with the rest being autoStart: false. When the user opts-out we reload the window, but the user might lose saved work with this approach.

edelgado commented 5 months ago

+1 I'd love to be able to disable features from the running instance of the agent: window.newrelic.

I tried adding new keys to window.newrelic.init like:

window.newrelic.init.spa = {enabled: false};

But that seems to have no effect.

Ivan-accedo commented 2 weeks ago

Hi!

I also need to disable to stop the browser agent, e.g. when the user declines the tracking after the newrelic.start().

Can you help me please?

Thanks in advance!