Skip to content

Commit ec77206

Browse files
committed
adding llmobs plugin and tests
1 parent 6360b8d commit ec77206

File tree

6 files changed

+1024
-3
lines changed

6 files changed

+1024
-3
lines changed
Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,24 @@
11
'use strict'
22

3+
const mcpClientLLMObsPlugins = require('../../dd-trace/src/llmobs/plugins/mcp-client')
34
const CompositePlugin = require('../../dd-trace/src/plugins/composite')
45
const clientPlugin = require('./client')
56

7+
const plugins = {}
8+
9+
// ordering here is important - the llm observability plugin must come first
10+
// so that we can add annotations associated with the span before it finishes.
11+
// however, because the tracing plugin uses `bindStart` vs the llmobs' `start`,
12+
// the span is guaranteed to be created in the tracing plugin before the llmobs one is called
13+
for (const Plugin of mcpClientLLMObsPlugins) {
14+
plugins[Plugin.id] = Plugin
15+
}
16+
17+
Object.assign(plugins, clientPlugin)
18+
619
class McpClientPlugin extends CompositePlugin {
720
static id = 'mcp-client'
8-
static plugins = {
9-
...clientPlugin,
10-
}
21+
static plugins = plugins
1122
}
1223

1324
module.exports = McpClientPlugin

0 commit comments

Comments
 (0)