feat(node): Add first-party Mastra integration - #23823
Draft
RulaKhaled wants to merge 1 commit into
Draft
Conversation
RulaKhaled
force-pushed
the
rolaabuhasna/mastra-exporter
branch
from
September 1, 2026 10:11
b5821be to
2c85c6e
Compare
Contributor
size-limit report 📦
|
Mastra is exporter-based, so we hook the constructor, register a Sentry exporter, and bootstrap an observability pipeline when the app has not configured one.
RulaKhaled
force-pushed
the
rolaabuhasna/mastra-exporter
branch
from
September 1, 2026 15:38
8beaa13 to
18578a1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Mastra agent traces now come from the SDK:
invoke_agent,chat, andexecute_toolspans, on by default for Node-family SDKs.Ref JS-3455 (dup JSSDK-21).
How it attaches
Mastraconstructor and registers our exporter viaregisterExporter().@mastra/observabilitywhen that package is already installed. We never add it ourselves.What we emit
workflow_step,memory_operation,processor_run,scorer_*) are dropped; children re-parent onto the nearest exported ancestor.model_inferenceis dropped too. Mastra nestsmodel_generation > model_step > model_inference, and the inference span repeats the generation’s model/usage — exporting both produced a duplicate nestedchatper step.model_generationis thegen_ai.chatspan.Note to reviewer: 🗯️
This diff is large mostly because of Node integration tests and the @mastra/* yarn.lock bump, not because the SDK surface is huge.
The product decisions are in three files:
If you are checking that auto-instrumentation actually hooks Mastra, also glance at packages/server-utils/src/orchestrion/config/mastra.ts