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

Exclude/ignore URLs? #665

Closed
nuragic opened this issue Mar 1, 2020 · 7 comments
Closed

Exclude/ignore URLs? #665

nuragic opened this issue Mar 1, 2020 · 7 comments

Comments

@nuragic
Copy link

nuragic commented Mar 1, 2020

Hello,

I can't find any option in the docs, so my question is: how can I disable the agent sending transactions for certain URLs like e.g. the google analytics one? Right now (by default config) each time an event is sent to the google analytics service via HTTP, another request is made by the agent to report that request... I would expect something like this in the config object:

excludeOrigins: ['analytics.google.com', 'whatever.org', 'etc…']

But that option doesn't exist! 😅 Is there anything in place in order to do this?

Thanks!

@vigneshshanmugam
Copy link
Member

Thanks for using the agent . if you already know the transaction name. You can use this ignoreTransactions option to not report these to the server.
https://www.elastic.co/guide/en/apm/agent/rum-js/current/configuration.html#ignore-transactions

@nuragic
Copy link
Author

nuragic commented Mar 3, 2020

Hey thanks for answering! The problem is that I'm not creating custom transactions, it's an automatic one (http-request)... so I don't know the name.

In general it's good to track all HTTP requests... however, there're origins that we trust, so we don't want to track those requests...

@vigneshshanmugam
Copy link
Member

When you mean by trused domains (assuming they are third party providers), you can still use the ignoreTransactions config since transaction names for third party API calls always have the full URL in the name.

Example:

  • API call to GA -> GET www.google-analytics.com/event/
  • API call to same origin -> GET /event

@nuragic
Copy link
Author

nuragic commented Mar 4, 2020

Ahh ok, now I see! Got it! Many thanks!

@nuragic nuragic closed this as completed Mar 4, 2020
@Frintrop
Copy link

Frintrop commented Jun 2, 2020

Hi .. i tried that with reg exp but it looks like apm is ignoring my regexp.
I tried
, ignoreTransactions: ['POST https://recorder.sessionstack.com*','PUT https://recorder.sessionstack.com*']

or
ignoreTransactions: ['POST https://recorder.sessionstack.com.','PUT https://recorder.sessionstack.com.']

or
ignoreTransactions: [POST https://recorder.sessionstack.com.,PUT https://recorder.sessionstack.com.]

or
ignoreTransactions: [.recorder.sessionstack.com.]

@vigneshshanmugam
Copy link
Member

@Frintrop You have to pass in RegExp object and not string. Check the documentation here https://www.elastic.co/guide/en/apm/agent/rum-js/current/configuration.html#ignore-transactions

const config = {
   ignoreTransactions: [new RegExp('')]
}

@Frintrop
Copy link

Frintrop commented Jun 15, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants