@@ -83,7 +83,7 @@ export type SpanStatusType =
8383 * @param httpStatus The HTTP response status code.
8484 * @returns The span status or unknown_error.
8585 */
86- export function spanStatusfromHttpCode ( httpStatus : number ) : SpanStatusType {
86+ export function getSpanStatusFromHttpCode ( httpStatus : number ) : SpanStatusType {
8787 if ( httpStatus < 400 && httpStatus >= 100 ) {
8888 return 'ok' ;
8989 }
@@ -123,6 +123,17 @@ export function spanStatusfromHttpCode(httpStatus: number): SpanStatusType {
123123 return 'unknown_error' ;
124124}
125125
126+ /**
127+ * Converts a HTTP status code into a {@link SpanStatusType}.
128+ *
129+ * @deprecated Use {@link spanStatusFromHttpCode} instead.
130+ * This export will be removed in v8 as the signature contains a typo.
131+ *
132+ * @param httpStatus The HTTP response status code.
133+ * @returns The span status or unknown_error.
134+ */
135+ export const spanStatusfromHttpCode = getSpanStatusFromHttpCode ;
136+
126137/**
127138 * Sets the Http status attributes on the current span based on the http code.
128139 * Additionally, the span's status is updated, depending on the http code.
@@ -140,7 +151,7 @@ export function setHttpStatus(span: Span, httpStatus: number): void {
140151 // eslint-disable-next-line deprecation/deprecation
141152 span . setData ( 'http.response.status_code' , httpStatus ) ;
142153
143- const spanStatus = spanStatusfromHttpCode ( httpStatus ) ;
154+ const spanStatus = getSpanStatusFromHttpCode ( httpStatus ) ;
144155 if ( spanStatus !== 'unknown_error' ) {
145156 span . setStatus ( spanStatus ) ;
146157 }
0 commit comments