Uh oh!
There was an error while loading. Please reload this page.
feat(core): MCP Server - Capture prompt results from prompt function calls - #17284
Conversation
betegon
commented
Aug 1, 2025
@sentry review |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
feel free to merge @betegon (make sure you squash and merge). Also if we need this backported to v9 you'll need to cherry-pick the commit and open it against the |
Uh oh!
There was an error while loading. Please reload this page.
AbhiPrasad
commented
Aug 6, 2025
actually whatever I'll just do it 😄 |
betegon
commented
Aug 6, 2025
thanks @AbhiPrasad . I'm on PTO this week so it's been a bit difficult to keep up 😆 |
…calls (#17284) closes#17283 includes these attributes for `mcp.server` spans: - `mcp.prompt.result.description` - `mcp.prompt.result.message_content` - `mcp.prompt.result.message_role` - `mcp.prompt.result.message_count` Example: <img width="835" height="300" alt="Screenshot 2025-08-01 at 12 40 46" src="https://github.com/user-attachments/assets/592d876b-807a-4f3e-a9b2-406e10f5a83d" /> Needed to make `attributeExtraction.ts` <300 lines of code (requirement) so it's now split between `sessionExtraction.ts`, `sessionExtraction.ts` and `resultExtraction.ts`. So changes explained so it's easier to review: - The only function this PR adds is `extractPromptResultAttributes` inside `resultExtraction.ts`. - It adds the prompt results as PII in `piiFiltering.ts`. Just add them to the `set`. - adds a `else if (method === 'prompts/get')` to execute the `extractPromptResultAttributes` function. - adds a test that checks we're capturing the results and updates the PII test to check PII result attributes are being removed if sending PII is not enabled.
…calls (#17284) closes#17283 includes these attributes for `mcp.server` spans: - `mcp.prompt.result.description` - `mcp.prompt.result.message_content` - `mcp.prompt.result.message_role` - `mcp.prompt.result.message_count` Example: <img width="835" height="300" alt="Screenshot 2025-08-01 at 12 40 46" src="https://github.com/user-attachments/assets/592d876b-807a-4f3e-a9b2-406e10f5a83d" /> Needed to make `attributeExtraction.ts` <300 lines of code (requirement) so it's now split between `sessionExtraction.ts`, `sessionExtraction.ts` and `resultExtraction.ts`. So changes explained so it's easier to review: - The only function this PR adds is `extractPromptResultAttributes` inside `resultExtraction.ts`. - It adds the prompt results as PII in `piiFiltering.ts`. Just add them to the `set`. - adds a `else if (method === 'prompts/get')` to execute the `extractPromptResultAttributes` function. - adds a test that checks we're capturing the results and updates the PII test to check PII result attributes are being removed if sending PII is not enabled. (cherry picked from commit 0e05a40)
closes#17283
includes these attributes for
mcp.serverspans:mcp.prompt.result.descriptionmcp.prompt.result.message_contentmcp.prompt.result.message_rolemcp.prompt.result.message_countExample:

Needed to make
attributeExtraction.ts<300 lines of code (requirement) so it's now split betweensessionExtraction.ts,sessionExtraction.tsandresultExtraction.ts.So changes explained so it's easier to review:
extractPromptResultAttributesinsideresultExtraction.ts.piiFiltering.ts. Just add them to theset.else if (method === 'prompts/get')to execute theextractPromptResultAttributesfunction.