Open talhaawan7 opened 1 year ago
Hi @talhaawan7,
Thanks for reaching us!
If I delay the call by some seconds (around 2 or above), I get two transactions, and the ignore works for the second call. But I want to avoid this workaround and send the call immediately but exclude it from APM.
The first time doesn't work because the request that you are doing (with axios) is being included as a span of the ongoing transaction (the page load one). This is important given that the ignoreTransactions
checks transactionNames
and not spans. More info on this link
The second time works because there is no ongoing transaction, so the agent creates an http-request
transaction from the request, so, since this time is not a span the ignoreTransaction
config applies properly.
There is a pending issue whose goal is to implement an ignoreSpan config: https://github.com/elastic/apm-agent-rum-js/issues/1130. You will also find there a workaround that should help you.
The other suggested way was to use addFilter, but the URL I'm trying to exclude doesn't get in this filter for the first transaction on page-load.
Could you check if it starts working with the workaround provided shared above?
Btw, in case helps you for debugging purposes, there is a way to see the payload of the beacons sent to the server decoded that is available since 5.11.1. More info here: https://www.elastic.co/guide/en/apm/agent/rum-js/current/troubleshooting.html#disable-events-payload-compression
Let me know if this helps you.
Thanks, Alberto
Hi @devcorpio
Thank you for the reply!
The workaround only helps remove a particular span from showing up on the APM dashboard, but it's still calculated in the total time calculation. So the whole purpose of ignoring it is lost.
I see another issue related to this, which in turn is linked again with the ignoreSpan feature request.
Just want to confirm: As of now, is there any way to exclude the url AND exclude it from the total time calculation?
Hi team!
We're trying to stop a certain URL from appearing in the APM dashboard.
Here's the example code in React:
Using version
@elastic/apm-rum": "^5.12.0
,I've put the URL in
ignoreTransactions
, but that doesn't seem to work on page-load. It only works in later transactions. The other suggested way was to useaddFilter
, but the URL I'm trying to exclude doesn't get in this filter for the first transaction on page-load.If I delay the call by some seconds (around 2 or above), I get two transactions, and the ignore works for the second call. But I want to avoid this workaround and send the call immediately but exclude it from APM.
Also, when I console.log the payload inside
addFilter
it only has one transaction and contains no span (as mentioned in the docs here)