@mastra/observability 1.18.0 → 1.18.1-alpha.0

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.cjs CHANGED
@@ -1699,6 +1699,7 @@ function estimateCostForMeter(args) {
1699
1699
  */
1700
1700
  /** Emit duration metrics for a live span. */
1701
1701
  function emitDurationMetrics(span, metrics) {
1702
+ if (span.isEvent) return;
1702
1703
  const durationMetricName = getDurationMetricName(span);
1703
1704
  if (!durationMetricName || !span.startTime || !span.endTime) return;
1704
1705
  const durationMs = span.endTime.getTime() - span.startTime.getTime();
@@ -2986,6 +2987,7 @@ var BaseSpan = class BaseSpan {
2986
2987
  this.startTime = options.startTime ?? /* @__PURE__ */ new Date();
2987
2988
  this.observabilityInstance = observabilityInstance;
2988
2989
  this.isEvent = options.isEvent ?? false;
2990
+ if (this.isEvent) this.endTime = this.startTime;
2989
2991
  this.tracingPolicy = options.tracingPolicy;
2990
2992
  this.traceState = options.traceState;
2991
2993
  const parent = options.parent;