Repository navigation
feat(tools): Add outputSchema to get_profile - #2023
Merged
Merged
Conversation
Return the aggregated transaction flamegraph as structured content instead of markdown. Frames are listed once in `analysis.frames` and referenced by index from top functions and hot path stacks, so shared parents are not repeated per hot path. Missing data stays a successful result, reported by `hasCurrentData` / `hasBaselineData` with a null analysis or comparison. Generic follow-up guidance from the old markdown (caching, N+1 review, regression investigation, no-data troubleshooting) moves into the tool hints. The now-unused flamegraph markdown formatters, `formatPercentage`, and the insight icons are removed. Co-Authored-By: David Cramer <[email protected]>
Split userCodeMs and libraryMs by the leaf frame of each main-thread sample so they add up to estimatedTotalMs. Summing inclusive sumDuration over nested hotspots double counted time. Rename the frame sampleCount to occurrences and drop percentOfSamples: vroom's frame_infos.count sums call-tree occurrences, not samples, so it can exceed the sample count. Map the API's "" and 0 file and line placeholders to null. Co-Authored-By: David Cramer <[email protected]>
…aceholders Co-Authored-By: David Cramer <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Sort improvements before unchanged frames so the truncated comparison changes list always contains a frame that matches the reported status.
sentry-junior Bot
added a commit
that referenced
this pull request
Nov 5, 2026
#2023 landed get_profile structured output, so the profile markdown formatter and its test have no callers left. Remove both and regenerate tool definitions.
7 tasks done
This branch was previously deployed
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.
get_profile("Get Transaction Profile") now returns anoutputSchemaand schema-conformingstructuredContentfor the aggregated transaction flamegraph. Errors still throw.Each frame appears once in
analysis.frames.topFunctions, the hot pathstackarrays and the hot pathleafvalues point to frames by index, so a shared parent frame isn't repeated for every hot path. Fields are mapped explicitly, and a no-leak test checks key names and a distinctive raw fixture value.Fixes from review
userCodeMsandlibraryMsnow split the main thread'ssample_durations_nsby whether each sample's leaf frame is application code.sumDurationover the top 20 frames, so they could exceedestimatedTotalMs.libraryMsisestimatedTotalMs − userCodeMs, so the two always add up. A test checks this.sumSelfTimeisn't used, because vroom counts library children inside an app frame's self time.sampleCountrenamed tooccurrences: vroom'sframe_infos.countsums node occurrences, not samples. FramepercentOfSamplesis dropped. Hot paths keepsampleCountandpercentOfSamples, which really are sample-based.fileandline: this applies to frames and to comparisonchanges, and the""and0placeholders map to null. Both cases are tested.estimatedTotalMsdescription: it now reads "Sampled duration across the aggregated stacks returned", because vroom keeps only the top 1000 stacks.Tokens (o200k_base, realistic fixture, JSON vs old markdown)
focusOnUserCode=truefocusOnUserCode=falseThe outputSchema is 865 tokens and the description is 449.
measure-tokensdoesn't count the outputSchema.Follow-up (A), known existing bug, not changed here: the comparison compares absolute
sumDurationacross windows of different length (7d vs 14d), so results lean toward "improvement". It should normalize by window length or sample count.Merge note: this PR and the
get_profile_detailsPR both touch the profile formatter. Whichever merges second mustgit rmbothpackages/mcp-core/src/tools/support/profile/formatter.tsandformatter.test.ts, then regenerate. Keeping either side's formatter breaks tsc or leaves dead code.On rebase: regenerate
toolDefinitions.jsonwithpnpm run --filter @sentry/mcp-core generate-definitions.Checks run with
SENTRY_AUTH_TOKENunset: generate-definitions (no diff), mcp-core tsc, full mcp-core vitest and root lint all pass. Root tsc, test and build were not run.via @dcramer.
--
View Session [Sentry]