@mastra/observability 1.17.9-alpha.0 → 1.17.9-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.cjs CHANGED
@@ -5013,7 +5013,12 @@ var BaseObservabilityInstance = class extends _mastra_core_base.MastraBase {
5013
5013
  for (const processor of this.spanOutputProcessors) {
5014
5014
  if (!span) break;
5015
5015
  try {
5016
- span = processor.process(span);
5016
+ const processed = processor.process(span);
5017
+ if (processed !== void 0 && processed !== span) {
5018
+ this.logger.error(`[Observability] Processor error [name=${processor.name}]: process() must return the span it received (or undefined to drop it), not a copy. Span dropped.`);
5019
+ return;
5020
+ }
5021
+ span = processed;
5017
5022
  } catch (error) {
5018
5023
  this.logger.error(`[Observability] Processor error [name=${processor.name}]`, error);
5019
5024
  }
@@ -9313,9 +9318,10 @@ var SensitiveDataFilter = class {
9313
9318
  /**
9314
9319
  * Process a span by filtering sensitive data across its key fields.
9315
9320
  * Fields processed: attributes, metadata, input, output, errorInfo, requestContext.
9321
+ * The span is mutated in place, as the SpanOutputProcessor contract requires.
9316
9322
  *
9317
9323
  * @param span - The input span to filter
9318
- * @returns A new span with sensitive values redacted
9324
+ * @returns The same span instance with sensitive values redacted
9319
9325
  */
9320
9326
  process(span) {
9321
9327
  const indexedState = this.redactionStyle === "indexed" ? this.getTraceState(span.traceId) : void 0;