Skip to content

Filter http server spans that have 4xx http status in Node #11720

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

Open
4 of 17 tasks
AbhiPrasad opened this issue Apr 22, 2024 · 5 comments
Open
4 of 17 tasks

Filter http server spans that have 4xx http status in Node #11720

AbhiPrasad opened this issue Apr 22, 2024 · 5 comments

Comments

@AbhiPrasad
Copy link
Member

AbhiPrasad commented Apr 22, 2024

Problem Statement

Drop all 4xx root spans

Solution Brainstorm

Tasks

Preview Give feedback
  1. Integration: nest.js Package: node Type: Bug
    nicohrubec
  2. AbhiPrasad
  3. Package: bun
@AbhiPrasad AbhiPrasad added Type: Improvement Package: node Issues related to the Sentry Node SDK labels Apr 22, 2024
@mydea
Copy link
Member

mydea commented Apr 24, 2024

So to add some details on this:

We cannot do this in the sampler or in any hook for the instrumentation, because at this point we don't know the status yet.
So really the only thing we can realistically do is detect a http span with a 404 status code in the span exporter and drop the transaction event with all children there. But this means that during the transaction we'll still propagate the "incorrect" sampling decision (because we do not know yet that we'll drop this eventually). Which is not really great, but I can't think of anything else to do this.

Is this an OK solution for us? Or would it possibly make more sense to do this in relay then, and just drop this there (or have a new inbound filter for this, for example)?

It would also be interesting to see how others handle this, e.g. is it normal to filter these out in other otel products or not so much cc @smeubank

@cleptric
Copy link
Member

I would assume that in the majority of cases where an app emits a 404, very little application code is actually invoked. This leaves us with a much smaller subset of requests where the developer, somewhere in their application, emits a 404 on purpose. I think this is an OK trade-off to make.
We've been not sending any 404 transactions on Laravel for the last nine months, and so far, I haven't noticed a case where a trace was broken nor did we see any reports from users.

@MattJustMatt
Copy link

As a user I'd also like note that some amount of sampling of 4xx is useful for us. For example we throw 4xx for invalid auth headers and spikes here could alert us to upstream issues as well as providing telemetry on sign up issues (e.g. missing password validation requirements spiking might be a UX concern).

That said, I would love to be able to sample these independently.

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 Aug 13, 2024
@s1gr1d
Copy link
Member

s1gr1d commented Aug 14, 2024

Thanks for sharing your use case! I think it would make sense to filter the 4xx codes by default and give you the possibility to configure which codes you still want to have enabled.

@xr0master
Copy link
Contributor

As a user I'd also like note that some amount of sampling of 4xx is useful for us. For example we throw 4xx for invalid auth headers and spikes here could alert us to upstream issues as well as providing telemetry on sign up issues (e.g. missing password validation requirements spiking might be a UX concern).

You should use a log service instead of an issue service for this purpose. IMO

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

7 participants