@mastra/observability 1.17.9-alpha.2 → 1.18.0-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
@@ -3211,6 +3211,7 @@ var BaseSpan = class BaseSpan {
3211
3211
  requestContext: this.requestContext,
3212
3212
  isEvent: this.isEvent,
3213
3213
  isRootSpan: this.isRootSpan,
3214
+ ...this.isInternal ? { isInternal: true } : {},
3214
3215
  parentSpanId: this.getParentSpanId(includeInternalSpans),
3215
3216
  externalParentSpanId: this.getExportedExternalParentSpanId(includeInternalSpans),
3216
3217
  ...this.isRootSpan && this.tags?.length ? { tags: this.tags } : {}
@@ -4716,11 +4717,13 @@ var BaseObservabilityInstance = class extends _mastra_core_base.MastraBase {
4716
4717
  const enrichedMetadata = this.extractMetadataFromRequestContext(requestContext, mergedMetadata, traceState);
4717
4718
  const finalMetadata = !options.parent ? injectEnvironmentMetadata(enrichedMetadata, this.#mastraEnvironment) : enrichedMetadata;
4718
4719
  const tags = !options.parent ? tracingOptions?.tags : void 0;
4720
+ const name = !options.parent && tracingOptions?.rootSpanName ? tracingOptions.rootSpanName : rest.name;
4719
4721
  const traceId = !options.parent ? options.traceId ?? tracingOptions?.traceId : options.traceId;
4720
4722
  const parentSpanId = options.parentSpanId;
4721
4723
  const externalParentSpanId = !options.parent ? options.externalParentSpanId ?? tracingOptions?.parentSpanId : options.externalParentSpanId;
4722
4724
  const span = this.createSpan({
4723
4725
  ...rest,
4726
+ name,
4724
4727
  traceId,
4725
4728
  parentSpanId,
4726
4729
  externalParentSpanId,
@@ -4770,7 +4773,8 @@ var BaseObservabilityInstance = class extends _mastra_core_base.MastraBase {
4770
4773
  metadata: cached.metadata,
4771
4774
  entityType: cached.entityType,
4772
4775
  entityId: cached.entityId,
4773
- entityName: cached.entityName
4776
+ entityName: cached.entityName,
4777
+ tracingPolicy: cached.isInternal ? { internal: _mastra_core_observability.InternalSpans.ALL } : void 0
4774
4778
  });
4775
4779
  this.wireSpanLifecycle(span);
4776
4780
  return span;