Skip to content
Merged
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
3 changes: 3 additions & 0 deletions dev-packages/node-integration-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"dependencies": {
"@anthropic-ai/sdk": "0.133.0",
"@apollo/server": "^5.5.0",
"@aws-sdk/client-bedrock-runtime": "^3.1046.0",
"@aws-sdk/client-dynamodb": "^3.1046.0",
"@aws-sdk/client-kinesis": "^3.1146.0",
"@aws-sdk/client-lambda": "^3.1046.0",
Expand All @@ -46,6 +47,7 @@
"@langchain/openai": "^0.5.0",
"@mistralai/mistralai": "3.3.0",
"@modelcontextprotocol/client": "^2.0.0",
"@modelcontextprotocol/sdk": "1.32.2",
"@modelcontextprotocol/server": "^2.0.0",
"@nestjs/common": "^11",
"@nestjs/core": "^11",
Expand All @@ -62,6 +64,7 @@
"@types/mongodb": "^3.6.20",
"@types/mysql": "^2.15.21",
"@types/pg": "^8.6.5",
"@typesafe-ai/sdk": "^0.6.0",
"ai": "^4.3.16",
"amqplib": "^0.10.9",
"body-parser": "^2.3.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,9 @@ describe('awsIntegration - Bedrock', () => {
cleanupChildProcesses();
});

createEsmAndCjsTests(
__dirname,
'scenario.mjs',
'instrument.mjs',
(createTestRunner, test) => {
test('auto-instruments Bedrock Converse and InvokeModel', { timeout: 90_000 }, async () => {
await createTestRunner().ignore('event').expect({ span: assertBedrockSpans }).start().completed();
});
},
{ additionalDependencies: { '@aws-sdk/client-bedrock-runtime': '^3.1046.0' } },
);
createEsmAndCjsTests(__dirname, 'scenario.mjs', 'instrument.mjs', (createTestRunner, test) => {
test('auto-instruments Bedrock Converse and InvokeModel', { timeout: 90_000 }, async () => {
await createTestRunner().ignore('event').expect({ span: assertBedrockSpans }).start().completed();
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ describe.each(['v1', 'v2'])('MCP TypeScript SDK %s', sdk => {
expect(root?.attributes['test.mcp.handlers_verified']).toEqual({ type: 'integer', value: 4 });
});
},
{
additionalDependencies: sdk === 'v1' ? { '@modelcontextprotocol/sdk': '1.30.0' } : undefined,
copyPaths: ['run.cjs'],
},
{ copyPaths: ['run.cjs'] },
);
});
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,9 @@ describe('MCP server spans (streamed, manual instrumentation)', () => {
});
});

createEsmAndCjsTests(
__dirname,
'scenario-v1.mjs',
'instrument.mjs',
(createTestRunner, test) => {
test('captures an MCP v1 initialize request queued before transport start once', async () => {
await createTestRunner().unordered().expect({ span: assertInitializeSpan }).start().completed();
});
},
{ additionalDependencies: { '@modelcontextprotocol/sdk': '1.30.0' } },
);
createEsmAndCjsTests(__dirname, 'scenario-v1.mjs', 'instrument.mjs', (createTestRunner, test) => {
test('captures an MCP v1 initialize request queued before transport start once', async () => {
await createTestRunner().unordered().expect({ span: assertInitializeSpan }).start().completed();
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -25,55 +25,49 @@ describe('MCP server spans (streamed, auto-instrumentation, v1)', () => {
cleanupChildProcesses();
});

createEsmAndCjsTests(
__dirname,
'scenario.mjs',
'instrument.mjs',
(createTestRunner, test) => {
test('auto-instruments the initialize handshake', async () => {
await createTestRunner()
.unordered()
.expect({
span: container => {
const initialize = mcpSpan(container, 'initialize');
expect(initialize.name).toBe('initialize');
expect(initialize.attributes['sentry.origin']).toEqual({
type: 'string',
value: 'auto.function.mcp_server',
});
},
})
.start()
.completed();
});
createEsmAndCjsTests(__dirname, 'scenario.mjs', 'instrument.mjs', (createTestRunner, test) => {
test('auto-instruments the initialize handshake', async () => {
await createTestRunner()
.unordered()
.expect({
span: container => {
const initialize = mcpSpan(container, 'initialize');
expect(initialize.name).toBe('initialize');
expect(initialize.attributes['sentry.origin']).toEqual({
type: 'string',
value: 'auto.function.mcp_server',
});
},
})
.start()
.completed();
});

test('auto-instruments a resource read', async () => {
await createTestRunner()
.unordered()
.expect({
span: container => {
const resource = mcpSpan(container, 'resources/read');
expect(resource.name).toBe('resources/read');
expect(resource.attributes['mcp.resource.uri']?.value).toBe('echo://foobar');
},
})
.start()
.completed();
});
test('auto-instruments a resource read', async () => {
await createTestRunner()
.unordered()
.expect({
span: container => {
const resource = mcpSpan(container, 'resources/read');
expect(resource.name).toBe('resources/read');
expect(resource.attributes['mcp.resource.uri']?.value).toBe('echo://foobar');
},
})
.start()
.completed();
});

test('auto-instruments a tool call', async () => {
await createTestRunner()
.unordered()
.expect({
span: container => {
const tool = mcpSpan(container, 'tools/call');
expect(tool.name).toBe('tools/call echo');
},
})
.start()
.completed();
});
},
{ additionalDependencies: { '@modelcontextprotocol/sdk': '1.30.0' } },
);
test('auto-instruments a tool call', async () => {
await createTestRunner()
.unordered()
.expect({
span: container => {
const tool = mcpSpan(container, 'tools/call');
expect(tool.name).toBe('tools/call echo');
},
})
.start()
.completed();
});
});
});
Loading
Loading