Skip to content

Commit d5c827a

Browse files
committed
feat(node): Drop 3xx status code spans by default
In addition to 404, we now also drop 3xx (e.g. 301 MOVED_PERMANTENTLY) spans by default. These are usually not helpful.
1 parent 65162a2 commit d5c827a

File tree

1 file changed

+2
-2
lines changed
  • packages/node/src/integrations/http

1 file changed

+2
-2
lines changed

packages/node/src/integrations/http/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ interface HttpOptions {
7979
* By default, spans with 404 status code are ignored.
8080
* Expects an array of status codes or a range of status codes, e.g. [[300,399], 404] would ignore 3xx and 404 status codes.
8181
*
82-
* @default `[404]`
82+
* @default `[404, [300, 399]]`
8383
*/
8484
dropSpansForIncomingRequestStatusCodes?: (number | [number, number])[];
8585

@@ -184,7 +184,7 @@ export function _shouldInstrumentSpans(options: HttpOptions, clientOptions: Part
184184
* It creates breadcrumbs and spans for outgoing HTTP requests which will be attached to the currently active span.
185185
*/
186186
export const httpIntegration = defineIntegration((options: HttpOptions = {}) => {
187-
const dropSpansForIncomingRequestStatusCodes = options.dropSpansForIncomingRequestStatusCodes ?? [404];
187+
const dropSpansForIncomingRequestStatusCodes = options.dropSpansForIncomingRequestStatusCodes ?? [404, [300, 399]];
188188

189189
return {
190190
name: INTEGRATION_NAME,

0 commit comments

Comments
 (0)