Skip to content

Filter http.server spans with status code 4xx by default #16193

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

Closed
mydea opened this issue May 5, 2025 — with Linear · 2 comments · Fixed by #16205
Closed

Filter http.server spans with status code 4xx by default #16193

mydea opened this issue May 5, 2025 — with Linear · 2 comments · Fixed by #16205
Assignees
Labels
javascript Pull requests that update javascript code

Comments

Copy link
Member

mydea commented May 5, 2025

We want to filter http server spans with a 4xx (e.g. 404 or 401) status code by default, but allow to opt-out of this behavior.

This can probably be an option to the httpIntegration that defaults to 404 but allows to filter other status codes, if wanted.

@mydea mydea added the javascript Pull requests that update javascript code label May 5, 2025 — with Linear
@mydea mydea changed the title Filter http.server spans with status code 404 by default Filter http.server spans with status code 4xx by default May 5, 2025
@mydea mydea self-assigned this May 5, 2025
@mydea
Copy link
Member Author

mydea commented May 7, 2025

For now, we'll ignore 404 status codes by default only. While other status codes can make sense too, these could be tricky because we have to drop the spans tail-based, so propagation etc. may already have happened. This is unlikely with 404 but could be relevant with others. We can always think about extending the defaults if we want later.

mydea added a commit that referenced this issue May 7, 2025
This can be configured like this:

```js
httpIntegration({
  dropSpansForIncomingRequestStatusCodes: [404, [300,399]]
})
```

It defaults to `[404]`. 

Closes #16193
Copy link
Contributor

github-actions bot commented May 7, 2025

A PR closing this issue has just been released 🚀

This issue was referenced by PR #16205, which was included in the 9.16.0 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
javascript Pull requests that update javascript code
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant