@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.js CHANGED
@@ -1674,6 +1674,7 @@ function estimateCostForMeter(args) {
1674
1674
  */
1675
1675
  /** Emit duration metrics for a live span. */
1676
1676
  function emitDurationMetrics(span, metrics) {
1677
+ if (span.isEvent) return;
1677
1678
  const durationMetricName = getDurationMetricName(span);
1678
1679
  if (!durationMetricName || !span.startTime || !span.endTime) return;
1679
1680
  const durationMs = span.endTime.getTime() - span.startTime.getTime();
@@ -2961,6 +2962,7 @@ var BaseSpan = class BaseSpan {
2961
2962
  this.startTime = options.startTime ?? /* @__PURE__ */ new Date();
2962
2963
  this.observabilityInstance = observabilityInstance;
2963
2964
  this.isEvent = options.isEvent ?? false;
2965
+ if (this.isEvent) this.endTime = this.startTime;
2964
2966
  this.tracingPolicy = options.tracingPolicy;
2965
2967
  this.traceState = options.traceState;
2966
2968
  const parent = options.parent;