@mastra/client-js 1.60.1-alpha.0 → 1.60.1-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -160,6 +160,10 @@ var ObservabilityCollectorImpl = class {
160
160
  flush() {
161
161
  if (this.#flushed) return {};
162
162
  this.#flushed = true;
163
+ if (this.#spans.some((span) => span.endTimeNs < span.startTimeNs) || this.#executionStartMs !== void 0 && this.#executionEndMs !== void 0 && this.#executionEndMs < this.#executionStartMs) {
164
+ console.warn("Client observability timing ends before it starts; dropping telemetry.");
165
+ return {};
166
+ }
163
167
  const payload = {};
164
168
  if (this.#executionStartMs !== void 0 && this.#executionEndMs !== void 0) payload.executionDurationMs = this.#executionEndMs - this.#executionStartMs;
165
169
  if (this.#spans.length > 0) payload.spans = { resourceSpans: [{ scopeSpans: [{