@opentelemetry/sdk-trace-base
Advanced tools
Comparing version 1.22.0 to 1.23.0
@@ -139,3 +139,10 @@ /* | ||
// outside the execution of this callback. | ||
var spans = _this._finishedSpans.splice(0, _this._maxExportBatchSize); | ||
var spans; | ||
if (_this._finishedSpans.length <= _this._maxExportBatchSize) { | ||
spans = _this._finishedSpans; | ||
_this._finishedSpans = []; | ||
} | ||
else { | ||
spans = _this._finishedSpans.splice(0, _this._maxExportBatchSize); | ||
} | ||
var doExport = function () { | ||
@@ -153,11 +160,17 @@ return _this._exporter.export(spans, function (result) { | ||
}; | ||
var pendingResources = spans | ||
.map(function (span) { return span.resource; }) | ||
.filter(function (resource) { return resource.asyncAttributesPending; }); | ||
var pendingResources = null; | ||
for (var i = 0, len = spans.length; i < len; i++) { | ||
var span = spans[i]; | ||
if (span.resource.asyncAttributesPending && | ||
span.resource.waitForAsyncAttributes) { | ||
pendingResources !== null && pendingResources !== void 0 ? pendingResources : (pendingResources = []); | ||
pendingResources.push(span.resource.waitForAsyncAttributes()); | ||
} | ||
} | ||
// Avoid scheduling a promise to make the behavior more predictable and easier to test | ||
if (pendingResources.length === 0) { | ||
if (pendingResources === null) { | ||
doExport(); | ||
} | ||
else { | ||
Promise.all(pendingResources.map(function (resource) { var _a; return (_a = resource.waitForAsyncAttributes) === null || _a === void 0 ? void 0 : _a.call(resource); })).then(doExport, function (err) { | ||
Promise.all(pendingResources).then(doExport, function (err) { | ||
globalErrorHandler(err); | ||
@@ -164,0 +177,0 @@ reject(err); |
@@ -67,3 +67,3 @@ import { Context, Exception, HrTime, Link, Span as APISpan, SpanAttributes, SpanAttributeValue, SpanContext, SpanKind, SpanStatus, TimeInput } from '@opentelemetry/api'; | ||
* If the given attribute value is of type string and has more characters than given {@code attributeValueLengthLimit} then | ||
* return string with trucated to {@code attributeValueLengthLimit} characters | ||
* return string with truncated to {@code attributeValueLengthLimit} characters | ||
* | ||
@@ -70,0 +70,0 @@ * If the given attribute value is array of strings then |
@@ -307,3 +307,3 @@ /* | ||
* If the given attribute value is of type string and has more characters than given {@code attributeValueLengthLimit} then | ||
* return string with trucated to {@code attributeValueLengthLimit} characters | ||
* return string with truncated to {@code attributeValueLengthLimit} characters | ||
* | ||
@@ -310,0 +310,0 @@ * If the given attribute value is array of strings then |
@@ -1,2 +0,2 @@ | ||
export declare const VERSION = "1.22.0"; | ||
export declare const VERSION = "1.23.0"; | ||
//# sourceMappingURL=version.d.ts.map |
@@ -17,3 +17,3 @@ /* | ||
// this is autogenerated file, see scripts/version-update.js | ||
export var VERSION = '1.22.0'; | ||
export var VERSION = '1.23.0'; | ||
//# sourceMappingURL=version.js.map |
@@ -136,3 +136,10 @@ /* | ||
// outside the execution of this callback. | ||
const spans = this._finishedSpans.splice(0, this._maxExportBatchSize); | ||
let spans; | ||
if (this._finishedSpans.length <= this._maxExportBatchSize) { | ||
spans = this._finishedSpans; | ||
this._finishedSpans = []; | ||
} | ||
else { | ||
spans = this._finishedSpans.splice(0, this._maxExportBatchSize); | ||
} | ||
const doExport = () => this._exporter.export(spans, result => { | ||
@@ -148,11 +155,17 @@ var _a; | ||
}); | ||
const pendingResources = spans | ||
.map(span => span.resource) | ||
.filter(resource => resource.asyncAttributesPending); | ||
let pendingResources = null; | ||
for (let i = 0, len = spans.length; i < len; i++) { | ||
const span = spans[i]; | ||
if (span.resource.asyncAttributesPending && | ||
span.resource.waitForAsyncAttributes) { | ||
pendingResources !== null && pendingResources !== void 0 ? pendingResources : (pendingResources = []); | ||
pendingResources.push(span.resource.waitForAsyncAttributes()); | ||
} | ||
} | ||
// Avoid scheduling a promise to make the behavior more predictable and easier to test | ||
if (pendingResources.length === 0) { | ||
if (pendingResources === null) { | ||
doExport(); | ||
} | ||
else { | ||
Promise.all(pendingResources.map(resource => { var _a; return (_a = resource.waitForAsyncAttributes) === null || _a === void 0 ? void 0 : _a.call(resource); })).then(doExport, err => { | ||
Promise.all(pendingResources).then(doExport, err => { | ||
globalErrorHandler(err); | ||
@@ -159,0 +172,0 @@ reject(err); |
@@ -67,3 +67,3 @@ import { Context, Exception, HrTime, Link, Span as APISpan, SpanAttributes, SpanAttributeValue, SpanContext, SpanKind, SpanStatus, TimeInput } from '@opentelemetry/api'; | ||
* If the given attribute value is of type string and has more characters than given {@code attributeValueLengthLimit} then | ||
* return string with trucated to {@code attributeValueLengthLimit} characters | ||
* return string with truncated to {@code attributeValueLengthLimit} characters | ||
* | ||
@@ -70,0 +70,0 @@ * If the given attribute value is array of strings then |
@@ -248,3 +248,3 @@ /* | ||
* If the given attribute value is of type string and has more characters than given {@code attributeValueLengthLimit} then | ||
* return string with trucated to {@code attributeValueLengthLimit} characters | ||
* return string with truncated to {@code attributeValueLengthLimit} characters | ||
* | ||
@@ -251,0 +251,0 @@ * If the given attribute value is array of strings then |
@@ -1,2 +0,2 @@ | ||
export declare const VERSION = "1.22.0"; | ||
export declare const VERSION = "1.23.0"; | ||
//# sourceMappingURL=version.d.ts.map |
@@ -17,3 +17,3 @@ /* | ||
// this is autogenerated file, see scripts/version-update.js | ||
export const VERSION = '1.22.0'; | ||
export const VERSION = '1.23.0'; | ||
//# sourceMappingURL=version.js.map |
@@ -139,3 +139,10 @@ "use strict"; | ||
// outside the execution of this callback. | ||
const spans = this._finishedSpans.splice(0, this._maxExportBatchSize); | ||
let spans; | ||
if (this._finishedSpans.length <= this._maxExportBatchSize) { | ||
spans = this._finishedSpans; | ||
this._finishedSpans = []; | ||
} | ||
else { | ||
spans = this._finishedSpans.splice(0, this._maxExportBatchSize); | ||
} | ||
const doExport = () => this._exporter.export(spans, result => { | ||
@@ -151,11 +158,17 @@ var _a; | ||
}); | ||
const pendingResources = spans | ||
.map(span => span.resource) | ||
.filter(resource => resource.asyncAttributesPending); | ||
let pendingResources = null; | ||
for (let i = 0, len = spans.length; i < len; i++) { | ||
const span = spans[i]; | ||
if (span.resource.asyncAttributesPending && | ||
span.resource.waitForAsyncAttributes) { | ||
pendingResources !== null && pendingResources !== void 0 ? pendingResources : (pendingResources = []); | ||
pendingResources.push(span.resource.waitForAsyncAttributes()); | ||
} | ||
} | ||
// Avoid scheduling a promise to make the behavior more predictable and easier to test | ||
if (pendingResources.length === 0) { | ||
if (pendingResources === null) { | ||
doExport(); | ||
} | ||
else { | ||
Promise.all(pendingResources.map(resource => { var _a; return (_a = resource.waitForAsyncAttributes) === null || _a === void 0 ? void 0 : _a.call(resource); })).then(doExport, err => { | ||
Promise.all(pendingResources).then(doExport, err => { | ||
(0, core_1.globalErrorHandler)(err); | ||
@@ -162,0 +175,0 @@ reject(err); |
@@ -67,3 +67,3 @@ import { Context, Exception, HrTime, Link, Span as APISpan, SpanAttributes, SpanAttributeValue, SpanContext, SpanKind, SpanStatus, TimeInput } from '@opentelemetry/api'; | ||
* If the given attribute value is of type string and has more characters than given {@code attributeValueLengthLimit} then | ||
* return string with trucated to {@code attributeValueLengthLimit} characters | ||
* return string with truncated to {@code attributeValueLengthLimit} characters | ||
* | ||
@@ -70,0 +70,0 @@ * If the given attribute value is array of strings then |
@@ -251,3 +251,3 @@ "use strict"; | ||
* If the given attribute value is of type string and has more characters than given {@code attributeValueLengthLimit} then | ||
* return string with trucated to {@code attributeValueLengthLimit} characters | ||
* return string with truncated to {@code attributeValueLengthLimit} characters | ||
* | ||
@@ -254,0 +254,0 @@ * If the given attribute value is array of strings then |
@@ -1,2 +0,2 @@ | ||
export declare const VERSION = "1.22.0"; | ||
export declare const VERSION = "1.23.0"; | ||
//# sourceMappingURL=version.d.ts.map |
@@ -20,3 +20,3 @@ "use strict"; | ||
// this is autogenerated file, see scripts/version-update.js | ||
exports.VERSION = '1.22.0'; | ||
exports.VERSION = '1.23.0'; | ||
//# sourceMappingURL=version.js.map |
{ | ||
"name": "@opentelemetry/sdk-trace-base", | ||
"version": "1.22.0", | ||
"version": "1.23.0", | ||
"description": "OpenTelemetry Tracing", | ||
@@ -96,9 +96,9 @@ "main": "build/src/index.js", | ||
"dependencies": { | ||
"@opentelemetry/core": "1.22.0", | ||
"@opentelemetry/resources": "1.22.0", | ||
"@opentelemetry/semantic-conventions": "1.22.0" | ||
"@opentelemetry/core": "1.23.0", | ||
"@opentelemetry/resources": "1.23.0", | ||
"@opentelemetry/semantic-conventions": "1.23.0" | ||
}, | ||
"homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-sdk-trace-base", | ||
"sideEffects": false, | ||
"gitHead": "7be35c7845e206b27b682e8ce1cee850b09cec04" | ||
"gitHead": "5231aa255047fbc6ee3d6a299f4423ab2f8a5fbc" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
769572
8303
+ Added@opentelemetry/core@1.23.0(transitive)
+ Added@opentelemetry/resources@1.23.0(transitive)
+ Added@opentelemetry/semantic-conventions@1.23.0(transitive)
- Removed@opentelemetry/core@1.22.0(transitive)
- Removed@opentelemetry/resources@1.22.0(transitive)
- Removed@opentelemetry/semantic-conventions@1.22.0(transitive)
Updated@opentelemetry/core@1.23.0