File tree 3 files changed +16
-13
lines changed
3 files changed +16
-13
lines changed Original file line number Diff line number Diff line change @@ -202,16 +202,16 @@ export class Tracing implements Integration {
202
202
return event ;
203
203
}
204
204
205
- if (
206
- Tracing . options . maxTransactionDuration !== 0 &&
207
- Tracing . _isEnabled ( ) &&
208
- event . type === 'transaction' &&
209
- event . timestamp &&
210
- event . start_timestamp &&
211
- ( event . timestamp - event . start_timestamp > Tracing . options . maxTransactionDuration ||
212
- event . timestamp - event . start_timestamp < 0 )
213
- ) {
214
- return null ;
205
+ if ( Tracing . _isEnabled ( ) ) {
206
+ const isOutdatedTransaction =
207
+ event . timestamp &&
208
+ event . start_timestamp &&
209
+ ( event . timestamp - event . start_timestamp > Tracing . options . maxTransactionDuration ||
210
+ event . timestamp - event . start_timestamp < 0 ) ;
211
+
212
+ if ( Tracing . options . maxTransactionDuration !== 0 && event . type === 'transaction' && isOutdatedTransaction ) {
213
+ return null ;
214
+ }
215
215
}
216
216
217
217
return event ;
Original file line number Diff line number Diff line change @@ -238,7 +238,10 @@ export class Span implements SpanInterface, SpanContext {
238
238
*/
239
239
public setHttpStatus ( httpStatus : number ) : this {
240
240
this . setTag ( 'http.status_code' , String ( httpStatus ) ) ;
241
- this . setStatus ( SpanStatus . fromHttpCode ( httpStatus ) ) ;
241
+ const spanStatus = SpanStatus . fromHttpCode ( httpStatus ) ;
242
+ if ( spanStatus !== SpanStatus . UnknownError ) {
243
+ this . setStatus ( spanStatus ) ;
244
+ }
242
245
return this ;
243
246
}
244
247
Original file line number Diff line number Diff line change @@ -91,7 +91,7 @@ export enum SpanStatus {
91
91
/** The operation completed successfully. */
92
92
Ok = 'ok' ,
93
93
/** Deadline expired before operation could complete. */
94
- DealineExceeded = 'deadline_exceeded' ,
94
+ DeadlineExceeded = 'deadline_exceeded' ,
95
95
/** 401 Unauthorized (actually does mean unauthenticated according to RFC 7235) */
96
96
Unauthenticated = 'unauthenticated' ,
97
97
/** 403 Forbidden */
@@ -164,7 +164,7 @@ export namespace SpanStatus {
164
164
case 503 :
165
165
return SpanStatus . Unavailable ;
166
166
case 504 :
167
- return SpanStatus . DealineExceeded ;
167
+ return SpanStatus . DeadlineExceeded ;
168
168
default :
169
169
return SpanStatus . InternalError ;
170
170
}
You can’t perform that action at this time.
0 commit comments