11/* eslint-disable max-lines */
2- import { Primitive , Span as SpanInterface , SpanContext , Transaction } from '@sentry/types' ;
3- import { dropUndefinedKeys , timestampWithMs , uuid4 } from '@sentry/utils' ;
4-
5- import { SpanStatus } from './spanstatus' ;
2+ import { Primitive , Span as SpanInterface , SpanContext , SpanStatusType , Transaction } from '@sentry/types' ;
3+ import { dropUndefinedKeys , spanStatusfromHttpCode , timestampWithMs , uuid4 } from '@sentry/utils' ;
64
75/**
86 * Keeps track of finished spans for a given transaction
@@ -56,7 +54,7 @@ export class Span implements SpanInterface {
5654 /**
5755 * Internal keeper of the status
5856 */
59- public status ?: SpanStatus | string ;
57+ public status ?: SpanStatusType ;
6058
6159 /**
6260 * @inheritDoc
@@ -204,7 +202,7 @@ export class Span implements SpanInterface {
204202 /**
205203 * @inheritDoc
206204 */
207- public setStatus ( value : SpanStatus ) : this {
205+ public setStatus ( value : SpanStatusType ) : this {
208206 this . status = value ;
209207 return this ;
210208 }
@@ -214,8 +212,8 @@ export class Span implements SpanInterface {
214212 */
215213 public setHttpStatus ( httpStatus : number ) : this {
216214 this . setTag ( 'http.status_code' , String ( httpStatus ) ) ;
217- const spanStatus = SpanStatus . fromHttpCode ( httpStatus ) ;
218- if ( spanStatus !== SpanStatus . UnknownError ) {
215+ const spanStatus = spanStatusfromHttpCode ( httpStatus ) ;
216+ if ( spanStatus !== 'unknown_error' ) {
219217 this . setStatus ( spanStatus ) ;
220218 }
221219 return this ;
@@ -225,7 +223,7 @@ export class Span implements SpanInterface {
225223 * @inheritDoc
226224 */
227225 public isSuccess ( ) : boolean {
228- return this . status === SpanStatus . Ok ;
226+ return this . status === 'ok' ;
229227 }
230228
231229 /**
0 commit comments