diff --git a/packages/opentelemetry-core/src/common/time.ts b/packages/opentelemetry-core/src/common/time.ts index 8d3051b00c1..89f5bfd3f60 100644 --- a/packages/opentelemetry-core/src/common/time.ts +++ b/packages/opentelemetry-core/src/common/time.ts @@ -111,7 +111,7 @@ export function hrTimeDuration( export function hrTimeToTimeStamp(time: api.HrTime): string { const precision = NANOSECOND_DIGITS; const tmp = `${'0'.repeat(precision)}${time[1]}Z`; - const nanoString = tmp.substr(tmp.length - precision - 1); + const nanoString = tmp.substring(tmp.length - precision - 1); const date = new Date(time[0] * 1000).toISOString(); return date.replace('000Z', nanoString); } diff --git a/packages/opentelemetry-sdk-trace-base/src/Span.ts b/packages/opentelemetry-sdk-trace-base/src/Span.ts index b5f3b75b4b5..39a8b303080 100644 --- a/packages/opentelemetry-sdk-trace-base/src/Span.ts +++ b/packages/opentelemetry-sdk-trace-base/src/Span.ts @@ -377,7 +377,7 @@ export class Span implements APISpan, ReadableSpan { if (value.length <= limit) { return value; } - return value.substr(0, limit); + return value.substring(0, limit); } /**