Skip to content

Commit

Permalink
feat: Set log level for net breadcrumbs based on status code (#1070)
Browse files Browse the repository at this point in the history
  • Loading branch information
timfish authored Jan 27, 2025
1 parent c187b53 commit 0c2e628
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/main/integrations/net-breadcrumbs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
dynamicSamplingContextToSentryBaggageHeader,
fill,
generateSentryTraceHeader,
getBreadcrumbLogLevelFromHttpStatusCode,
getClient,
getCurrentScope,
getDynamicSamplingContextFromClient,
Expand Down Expand Up @@ -246,6 +247,7 @@ function addRequestBreadcrumb(
method: method,
status_code: res?.statusCode,
},
level: getBreadcrumbLogLevelFromHttpStatusCode(res?.statusCode),
},
{
event,
Expand Down
1 change: 1 addition & 0 deletions test/e2e/test-apps/other/net-breadcrumbs/event.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
"timestamp": 0,
"type": "http",
"category": "electron.net",
"level": "warning",
"data": {
"url": "http://localhost:8123/something",
"method": "GET",
Expand Down

0 comments on commit 0c2e628

Please sign in to comment.