Disabling transactions for a specific user agent with @sentry/nextjs #5437
Unanswered
benhodgson87
asked this question in
Q&A
Replies: 1 comment
-
@benhodgson87 fyi i think with version 7, this is now added to the event through this integration that is now automatically enabled https://docs.sentry.io/platforms/javascript/configuration/integrations/httpcontext/ I am adding this to my project now and will circle back and correct this comment if i find this not to be correct |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm currently battling trying to disable performance transactions for our ELB Healthcheck, but seem to be getting nowhere. This is using the
@sentry/nextjs
package.I've currently got an Event Processor set up in my client and server side Sentry configs which looks at
event.request.headers
to check for the presence of anELB-HealthChecker
user agent, and return null, however this has not stopped transaction events to/
from piling in and burning through our transaction allowance.Is the above a valid way to disable Sentry transactions for a healthcheck when using the Sentry nextjs package? If not what is the best way to achieve this? Otherwise I'm approaching the point of just disabling performance monitoring entirely.
EDIT:
Investigating this further, I've now managed to log out the event from the server. It appears that the
event
payload getting passed to the Event Processor on the server does not contain the user agent.Obviously this is why the above logic to kill the event when the User-Agent is the healthchecker is not running, as that does not exist in the payload on the server.
However the event logged in Sentry still has the User-Agent set to the HealthChecker for these events. Where is this User Agent coming from, and is there any way to detect it in the server side Next config to block this event from sending?
Beta Was this translation helpful? Give feedback.
All reactions