Skip to content

Commit 02703f1

Browse files
anuraagaJoshMock
andauthored
feat: initialize EDOT and MCP instrumentation (#64)
* feat: initialize EDOT and MCP instrumentation * Fix chmod --------- Co-authored-by: Josh Mock <[email protected]>
1 parent 9003045 commit 02703f1

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
* SPDX-License-Identifier: Apache-2.0
66
*/
77

8+
import "@elastic/opentelemetry-node";
9+
import "./telemetry.js";
10+
811
import { z } from "zod";
912
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
1013
import {

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"README.md"
2828
],
2929
"scripts": {
30-
"build": "tsc && shx chmod +x dist/*.js",
30+
"build": "tsc && shx chmod +x dist/index.js",
3131
"prepare": "npm run build",
3232
"watch": "tsc --watch",
3333
"start": "node dist/index.js",
@@ -38,7 +38,9 @@
3838
"generate-notice": "node ./scripts/generate-notice.js"
3939
},
4040
"dependencies": {
41+
"@arizeai/openinference-instrumentation-mcp": "^0.2.0",
4142
"@elastic/elasticsearch": "^9.0.0",
43+
"@elastic/opentelemetry-node": "^1.0.0",
4244
"@modelcontextprotocol/sdk": "1.12.1"
4345
},
4446
"engines": {

telemetry.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and contributors
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
import { MCPInstrumentation } from "@arizeai/openinference-instrumentation-mcp";
7+
import * as MCPServerStdioModule from "@modelcontextprotocol/sdk/server/stdio.js";
8+
9+
const mcpInstrumentation = new MCPInstrumentation();
10+
mcpInstrumentation.manuallyInstrument({
11+
serverStdioModule: MCPServerStdioModule,
12+
});

0 commit comments

Comments
 (0)