Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/add-mcp-server-tracing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"braintrust": minor
---

feat(mcp): Add MCP server tracing
23 changes: 23 additions & 0 deletions e2e/config/pr-comment-scenarios.json
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,29 @@
}
]
},
{
"scenarioDirName": "mcp-instrumentation",
"label": "MCP Instrumentation",
"metadataScenario": "mcp-instrumentation",
"variants": [
{
"variantKey": "mcp-sdk-v1",
"label": "sdk v1 pinned"
},
{
"variantKey": "mcp-sdk-v1-latest",
"label": "sdk v1 latest"
},
{
"variantKey": "mcp-server-v2",
"label": "server v2 pinned"
},
{
"variantKey": "mcp-server-v2-latest",
"label": "server v2 latest"
}
]
},
{
"scenarioDirName": "typesafe-instrumentation",
"label": "TypeSafe Instrumentation",
Expand Down
27 changes: 27 additions & 0 deletions e2e/helpers/normalize.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,33 @@ import { describe, expect, test } from "vitest";
import { normalizeForSnapshot } from "./normalize";

describe("normalizeForSnapshot", () => {
test.each([0, 0.1, 1.2])(
"normalizes tool wall time of %s seconds",
(seconds) => {
expect(
normalizeForSnapshot({
output: {
structuredContent: {
exit_code: 0,
output: "pi_tool_ok",
truncated: false,
wall_time_seconds: seconds,
},
},
}),
).toEqual({
output: {
structuredContent: {
exit_code: 0,
output: "pi_tool_ok",
truncated: false,
wall_time_seconds: 0,
},
},
});
},
);

test("normalizes a foreign repository path ending at a workspace directory", () => {
expect(
normalizeForSnapshot(
Expand Down
1 change: 1 addition & 0 deletions e2e/helpers/normalize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ const ZERO_NUMBER_KEYS = new Set([
"duration",
"github_copilot.context_window.current",
"time_to_first_token",
"wall_time_seconds",
]);
const XACT_VERSION_KEYS = new Set([
"currentVersion",
Expand Down
Loading
Loading