File tree Expand file tree Collapse file tree 3 files changed +16
-13
lines changed Expand file tree Collapse file tree 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 {
202202 return event ;
203203 }
204204
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+ }
215215 }
216216
217217 return event ;
Original file line number Diff line number Diff line change @@ -238,7 +238,10 @@ export class Span implements SpanInterface, SpanContext {
238238 */
239239 public setHttpStatus ( httpStatus : number ) : this {
240240 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+ }
242245 return this ;
243246 }
244247
Original file line number Diff line number Diff line change @@ -91,7 +91,7 @@ export enum SpanStatus {
9191 /** The operation completed successfully. */
9292 Ok = 'ok' ,
9393 /** Deadline expired before operation could complete. */
94- DealineExceeded = 'deadline_exceeded' ,
94+ DeadlineExceeded = 'deadline_exceeded' ,
9595 /** 401 Unauthorized (actually does mean unauthenticated according to RFC 7235) */
9696 Unauthenticated = 'unauthenticated' ,
9797 /** 403 Forbidden */
@@ -164,7 +164,7 @@ export namespace SpanStatus {
164164 case 503 :
165165 return SpanStatus . Unavailable ;
166166 case 504 :
167- return SpanStatus . DealineExceeded ;
167+ return SpanStatus . DeadlineExceeded ;
168168 default :
169169 return SpanStatus . InternalError ;
170170 }
You can’t perform that action at this time.
0 commit comments