[Node] NEW_RELIC_IGNORING_RULES does not work for www.google-analytics.com

I’m trying to filter out (ignore) requests to external services in the APM, so they don’t affect the Apdex and overall stats.

I’m doing it with the help of the NEW_RELIC_IGNORING_RULES env variable. It seems to work for sentry.io (the rule is ‘^/sentry\.io/’), but I cannot make it work for google analytics.
I tried a few rules, including ‘^/google-analytics\.com/’ and ‘^/www\.google-analytics\.com/’ (exactly as reported by new relic) but none of them works.

I used the following docs as a guide: https://docs.newrelic.com/docs/agents/nodejs-agent/api-guides/nodejs-agent-api#ignoring

I would appreciate any help with setting the correct value for the env variable.


Can anyone from the NewRelic team provide support for this issue?

How can I get a proper support for paid NewRelic account? Or there is no support and I should switch to DataDog or similar solution to make things work?

Hi @jacek.jaroczynski

Sorry it’s taken a while to get a response to you.

From first glance it seems that right now, your rules are targeting requests specifically to google-analytics.com/, but no url paths will be matched. You may just need to add a wildcard * to the end of your rules.

If that doesn’t work, can you share a link to where you are seeing these requests in the account? With that we can double/triple check that the rules perfectly match how the metrics are reporting in.

Hi Ryan,

It doesn’t seem to work.

We test it on the free account.

Once ready, we want to add it to this paid account.

We set it through Heroku env variables as it is quicker than committing changes through the configuration file.
It would be great, for testing purposes, to have a place directly in NR to set the ignoring rule.


1 Like

Interesting! I’m struggling to see any reason why this is not working for you! I’ll tag in @nmcnamara & @JoiConverse who can help us get a member of the support team to look into this, they will likely know more than I do on this. :slight_smile:

1 Like