@mastra/observability 1.16.4-alpha.0 → 1.16.4-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/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # @mastra/observability
2
2
 
3
+ ## 1.16.4-alpha.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Told bridges when a span ends without being exported, so they can free its state. ([#20463](https://github.com/mastra-ai/mastra/pull/20463))
8
+
9
+ A span dropped by `excludeSpanTypes`, a `spanFilter`, or a span output processor emits no span-end event, so bridges such as `@mastra/otel-bridge` and `@mastra/datadog` never learned the span was finished and held the state they created for it until shutdown. Those spans now trigger a `releaseSpan` call on the bridge instead.
10
+
11
+ Export behavior is unchanged: filtered spans are still not exported, and trace structure is untouched.
12
+
13
+ Fixes [#20368](https://github.com/mastra-ai/mastra/issues/20368).
14
+
15
+ - Updated dependencies [[`594f7b2`](https://github.com/mastra-ai/mastra/commit/594f7b28f5263fb9982fd50d95c471fb971ea984), [`311f943`](https://github.com/mastra-ai/mastra/commit/311f943bee60e8fdf5c84499ea50e884276c936c), [`0c89896`](https://github.com/mastra-ai/mastra/commit/0c8989673fb7d106837098398131e570c6023b68), [`23b4238`](https://github.com/mastra-ai/mastra/commit/23b423844ad0bcf2a502a68dd62866d6160f9f6d), [`e320a76`](https://github.com/mastra-ai/mastra/commit/e320a763feaf65c6be3cebecf746defcbde161b3), [`03b4918`](https://github.com/mastra-ai/mastra/commit/03b4918c80d188ce375334c393e131c6e94bd7eb), [`14ef73a`](https://github.com/mastra-ai/mastra/commit/14ef73a4bbd73e7808414816eb0628ce1d80b5d7), [`1d677d5`](https://github.com/mastra-ai/mastra/commit/1d677d5f99d7db403f7828585e8c25f299f72628), [`93e28ec`](https://github.com/mastra-ai/mastra/commit/93e28ecce9031c02397e0ae8406593e5c7a95883), [`729dab4`](https://github.com/mastra-ai/mastra/commit/729dab408faccfaef0cbb048e5a4338f9172847e), [`484003d`](https://github.com/mastra-ai/mastra/commit/484003d33ff59330c86b19863e4a38732d7e4155), [`933d291`](https://github.com/mastra-ai/mastra/commit/933d291146b789c19442ad206f94da3e4be90c64)]:
16
+ - @mastra/core@1.56.0-alpha.3
17
+
3
18
  ## 1.16.4-alpha.0
4
19
 
5
20
  ### Patch Changes
package/dist/index.cjs CHANGED
@@ -3353,6 +3353,20 @@ var BaseObservabilityInstance = class extends _mastra_core_base.MastraBase {
3353
3353
  exportedSpan
3354
3354
  };
3355
3355
  this.emitTracingEvent(event);
3356
+ return;
3357
+ }
3358
+ this.releaseBridgeSpan(span);
3359
+ }
3360
+ /**
3361
+ * Release bridge state for a span that ended without being exported.
3362
+ */
3363
+ releaseBridgeSpan(span) {
3364
+ const bridge = this.getBridge();
3365
+ if (!bridge?.releaseSpan) return;
3366
+ try {
3367
+ bridge.releaseSpan(span.id, span.traceId);
3368
+ } catch (error) {
3369
+ this.logger.error(`[Observability] Bridge releaseSpan error [spanId=${span.id}]`, error);
3356
3370
  }
3357
3371
  }
3358
3372
  /**