File tree Expand file tree Collapse file tree 4 files changed +14
-7
lines changed Expand file tree Collapse file tree 4 files changed +14
-7
lines changed Original file line number Diff line number Diff line change 66| repos | Configures the repository spec for events | yes | all | YES |
77| dist | Sets the distribution for all events | yes | all | YES |
88| server_name | Sets an optional server name (device name) | no | node | YES |
9- | attach_stacktrace | Attaches stacktraces to pure capture message / log integrations | no | all | NO |
9+ | attach_stacktrace | Attaches stacktraces to pure capture message / log integrations | no | all | YES |
1010| ignore_errors | A list of filters for errors not to send | yes | all | KINDA |
1111| max_breadcrumbs | Maximum number of breadcrumbs to record (0 = disable) | yes | all | YES |
1212| sample_rate | A global sample rate to apply to all events (0 - 1) | yes | all | YES |
Original file line number Diff line number Diff line change @@ -117,7 +117,7 @@ export class BrowserBackend implements Backend {
117117 message,
118118 } ;
119119
120- if ( syntheticException ) {
120+ if ( this . options . attachStacktrace && syntheticException ) {
121121 const stacktrace = computeStackTrace ( syntheticException ) ;
122122 const frames = prepareFramesForEvent ( stacktrace . stack ) ;
123123 event . stacktrace = {
Original file line number Diff line number Diff line change @@ -84,6 +84,9 @@ export interface Options {
8484 /** A global sample rate to apply to all events (0 - 1). */
8585 sampleRate ?: number ;
8686
87+ /** Attaches stacktraces to pure capture message / log integrations */
88+ attachStacktrace ?: boolean ;
89+
8790 /**
8891 * A callback invoked during event submission, allowing to cancel the process.
8992 * If unspecified, all events will be sent to Sentry.
Original file line number Diff line number Diff line change @@ -71,15 +71,19 @@ export class NodeBackend implements Backend {
7171 * @inheritDoc
7272 */
7373 public async eventFromMessage ( message : string , syntheticException : Error | null ) : Promise < SentryEvent > {
74- const stack = syntheticException ? await extractStackFromError ( syntheticException ) : [ ] ;
75- const frames = await parseStack ( stack ) ;
7674 const event : SentryEvent = {
75+ fingerprint : [ message ] ,
7776 message,
78- stacktrace : {
79- frames : prepareFramesForEvent ( frames ) ,
80- } ,
8177 } ;
8278
79+ if ( this . options . attachStacktrace && syntheticException ) {
80+ const stack = syntheticException ? await extractStackFromError ( syntheticException ) : [ ] ;
81+ const frames = await parseStack ( stack ) ;
82+ event . stacktrace = {
83+ frames : prepareFramesForEvent ( frames ) ,
84+ } ;
85+ }
86+
8387 return this . applyClientOptions ( event ) ;
8488 }
8589
You can’t perform that action at this time.
0 commit comments