{"id":83901,"date":"2026-07-26T05:57:19","date_gmt":"2026-07-25T21:57:19","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/83901.html"},"modified":"2026-07-26T05:57:19","modified_gmt":"2026-07-25T21:57:19","slug":"%e5%a6%82%e4%bd%95%e4%bd%bf%e7%94%a8-opentelemetry-%e5%92%8c-elastic-apm-%e8%bf%bd%e8%b8%aa-mcp-%e6%9c%8d%e5%8a%a1%e5%99%a8%e5%b7%a5%e5%85%b7%e8%b0%83%e7%94%a8","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/83901.html","title":{"rendered":"\u5982\u4f55\u4f7f\u7528 OpenTelemetry \u548c Elastic APM \u8ffd\u8e2a MCP \u670d\u52a1\u5668\u5de5\u5177\u8c03\u7528"},"content":{"rendered":"<p>\u4f5c\u8005&#xff1a;\u6765\u81ea Elastic\u00a0Jeffrey Rengifo<\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"449\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260725215717-6a65313de2fc1.png\" width=\"800\" \/><\/p>\n<p>\u4e3a MCP \u670d\u52a1\u5668\u6dfb\u52a0 OpenTelemetry \u8ffd\u8e2a&#xff0c;\u5728 Elastic APM \u4e2d\u53ef\u89c6\u5316\u5de5\u5177\u8c03\u7528\u6027\u80fd&#xff0c;\u5e76\u901a\u8fc7 Agent Builder MCP \u4ece Claude Desktop \u67e5\u8be2\u8ffd\u8e2a\u6570\u636e\u3002<\/p>\n<\/p>\n<p>MCP \u670d\u52a1\u5668\u672c\u8d28\u4e0a\u53ea\u662f\u4e00\u4e2a Node \u8fdb\u7a0b&#xff0c;\u8fd9\u610f\u5473\u7740\u53ea\u9700\u8981\u4e00\u4e2a &#8211;import \u6807\u5fd7\u5c31\u53ef\u4ee5\u542f\u7528 OpenTelemetry \u63d2\u6869\u3002\u771f\u6b63\u7684\u65b0\u53d8\u5316\u53d1\u751f\u5728\u8ffd\u8e2a\u6570\u636e\u8fdb\u5165 Elastic APM \u4e4b\u540e\u3002\u540c\u4e00\u4e2a\u751f\u6210\u8fd9\u4e9b\u8ffd\u8e2a\u6570\u636e\u7684 Claude Desktop \u4f1a\u8bdd&#xff0c;\u53ef\u4ee5\u901a\u8fc7 Elastic Agent Builder MCP \u518d\u6b21\u67e5\u8be2\u8fd9\u4e9b\u6570\u636e\u3002agent \u53ef\u4ee5\u5206\u6790\u81ea\u5df1\u7684\u5de5\u5177\u8c03\u7528\u5ef6\u8fdf\u3001\u8bc6\u522b\u6162\u5de5\u5177&#xff0c;\u5e76\u5728\u4e0d\u79bb\u5f00\u804a\u5929\u7a97\u53e3\u7684\u60c5\u51b5\u4e0b\u89e3\u91ca\u5931\u8d25\u539f\u56e0\u3002\u53ef\u89c2\u6d4b\u6027\u4e0d\u518d\u53ea\u662f\u4eba\u7c7b\u4e8b\u540e\u67e5\u770b\u7684 dashboard&#xff0c;\u800c\u662f agent \u5728\u5de5\u4f5c\u8fc7\u7a0b\u4e2d\u4f7f\u7528\u7684\u4e0a\u4e0b\u6587\u3002\u672c\u6587\u5c06\u4ecb\u7ecd MCP \u7684 OTel \u8bed\u4e49\u7ea6\u5b9a\u3001\u5de5\u5177 span \u7684\u5305\u88c5\u6a21\u5f0f&#xff0c;\u4ee5\u53ca\u5728 Elastic \u4fa7\u5982\u4f55\u95ed\u73af\u3002<\/p>\n<\/p>\n<h2>\u524d\u63d0\u6761\u4ef6<\/h2>\n<ul>\n<li>Elastic Cloud Hosted&#xff08; 9.3&#043; &#xff09;\u6216 Serverless<\/li>\n<li>Claude Desktop<\/li>\n<li>\u4e00\u4e2a\u4f7f\u7528 Elastic Distribution of OpenTelemetry&#xff08; EDOT &#xff09;\u8fdb\u884c instrumentation \u7684 MCP \u670d\u52a1\u5668\u3002\u4e0b\u6587\u4f1a\u4ecb\u7ecd\u5982\u4f55\u8fdb\u884c instrumentation \u3002<\/li>\n<\/ul>\n<h2>MCP \u670d\u52a1\u5668\u4e2d\u7684\u53ef\u89c2\u6d4b\u6027\u7f3a\u53e3<\/h2>\n<p>MCP \u670d\u52a1\u5668\u9ed8\u8ba4\u4e0d\u5e26\u4efb\u4f55\u5185\u7f6e\u53ef\u89c2\u6d4b\u6027&#xff0c;\u8fd9\u610f\u5473\u7740\u5de5\u5177\u8c03\u7528\u5ef6\u8fdf\u3001\u9519\u8bef\u548c\u6027\u80fd\u57fa\u7ebf\u5bf9\u5f00\u53d1\u8005\u6765\u8bf4\u662f\u4e0d\u53ef\u89c1\u7684\u3002MCP&#xff08; Model Context Protocol &#xff09;\u670d\u52a1\u5668\u6b63\u8d8a\u6765\u8d8a\u591a\u5730\u4f5c\u4e3a AI \u9a71\u52a8\u5e94\u7528\u7684\u57fa\u7840\u8bbe\u65bd&#xff0c;\u4e3a AI \u6a21\u578b\u63d0\u4f9b\u6570\u636e\u5e93\u3001API\u3001\u5185\u90e8\u5de5\u5177\u548c\u4e1a\u52a1\u6570\u636e\u8bbf\u95ee\u80fd\u529b\u3002\u800c MCP SDK \u672c\u8eab\u5e76\u4e0d\u4f1a\u5bf9\u8fd9\u4e9b\u8fdb\u884c\u63d2\u6869\u3002<\/p>\n<p>\u8fd9\u4e2a\u7f3a\u53e3\u4e3b\u8981\u4f53\u73b0\u5728\u4e09\u4e2a\u5177\u4f53\u65b9\u9762&#xff1a;<\/p>\n<ul>\n<li>\u5f53\u4e00\u6b21\u5de5\u5177\u8c03\u7528\u8017\u65f6 3 \u79d2\u65f6&#xff0c;\u4f60\u4e0d\u77e5\u9053\u74f6\u9888\u662f\u5728\u4e1a\u52a1\u903b\u8f91\u3001\u4e0b\u6e38 API \u8fd8\u662f\u6570\u636e\u5c42\u3002<\/li>\n<li>\u5f53\u5de5\u5177\u8c03\u7528\u5931\u8d25\u65f6&#xff0c;\u4f60\u53ea\u80fd\u770b\u5230\u9519\u8bef\u6d88\u606f&#xff0c;\u5374\u4e0d\u77e5\u9053\u670d\u52a1\u5668\u5728\u5931\u8d25\u4e4b\u524d\u6b63\u5728\u6267\u884c\u4ec0\u4e48\u3002<\/li>\n<li>\u5f53\u4f60\u65b0\u589e\u4e00\u4e2a\u5de5\u5177\u65f6&#xff0c;\u4f60\u6ca1\u6709\u4efb\u4f55\u6027\u80fd\u57fa\u7ebf\u53ef\u4ee5\u8fdb\u884c\u5bf9\u6bd4\u3002<\/li>\n<\/ul>\n<p>\u8fd9\u4e9b\u95ee\u9898\u548c\u4efb\u4f55\u540e\u7aef\u670d\u52a1\u9762\u4e34\u7684\u95ee\u9898\u5b8c\u5168\u76f8\u540c\u3002\u89e3\u51b3\u65b9\u6848\u4e5f\u4e0e\u540e\u7aef\u5f00\u53d1\u8005\u591a\u5e74\u6765\u4e00\u76f4\u4f7f\u7528\u7684\u65b9\u6cd5\u76f8\u540c&#xff1a;\u4f7f\u7528 OpenTelemetry \u8fdb\u884c\u5206\u5e03\u5f0f\u8ffd\u8e2a\u3002<\/p>\n<p>MCP \u670d\u52a1\u5668\u672c\u8d28\u4e0a\u662f\u6807\u51c6\u7684\u7a0b\u5e8f\u5316\u8fdb\u7a0b\u3002\u4ece\u63d2\u88c5\u7684\u89d2\u5ea6\u6765\u770b&#xff0c;\u5b83\u4eec\u5e76\u6ca1\u6709\u4ec0\u4e48\u7279\u6b8a\u4e4b\u5904\u3002\u4f60\u53ea\u9700\u8981\u6dfb\u52a0 OTel SDK&#xff0c;\u5728\u5de5\u5177\u5904\u7406\u5668\u5468\u56f4\u5b9a\u4e49 spans&#xff0c;\u5e76\u5c06 traces \u53d1\u9001\u5230\u4f60\u7684\u540e\u7aef\u3002\u552f\u4e00\u65b0\u7684\u90e8\u5206&#xff0c;\u662f\u9700\u8981\u77e5\u9053\u5e94\u8be5\u4f7f\u7528\u54ea\u4e9b span \u540d\u79f0\u548c\u5c5e\u6027&#xff0c;\u624d\u80fd\u8ba9\u4f60\u7684 traces \u5177\u6709\u610f\u4e49\u5e76\u4fdd\u6301\u4e00\u81f4\u3002<\/p>\n<\/p>\n<h2>\u6211\u4eec\u6784\u5efa\u4e86\u4ec0\u4e48<\/h2>\n<p>\u5728\u672c\u6587\u4e2d&#xff0c;\u6211\u4eec\u4f7f\u7528 &#064;modelcontextprotocol\/server-everything \u5305&#xff0c;\u8fd9\u662f Anthropic \u53d1\u5e03\u7684\u5b98\u65b9\u53c2\u8003 MCP \u670d\u52a1\u5668\u3002\u5b83\u5185\u7f6e\u4e86\u4e00\u7ec4\u5de5\u5177&#xff0c;\u8986\u76d6\u4e86\u4f60\u5728\u771f\u5b9e\u4e16\u754c MCP \u670d\u52a1\u5668\u4e2d\u4f1a\u9047\u5230\u7684\u5e38\u89c1\u6a21\u5f0f&#xff1a;\u7b80\u5355\u8bf7\u6c42\/\u54cd\u5e94\u3001\u5e26\u53c2\u6570\u8c03\u7528\u3001\u957f\u65f6\u95f4\u8fd0\u884c\u64cd\u4f5c&#xff0c;\u4ee5\u53ca\u8fd4\u56de\u7ed3\u6784\u5316\u6570\u636e\u7684\u8c03\u7528\u3002<\/p>\n<p>\u8be5\u670d\u52a1\u5668\u66b4\u9732\u4e86\u591a\u4e2a\u5de5\u5177\u3002\u5728\u672c\u6587\u4e2d&#xff0c;\u6211\u4eec\u4f7f\u7528\u5176\u4e2d\u4e09\u4e2a&#xff1a;<\/p>\n<ul>\n<li>echo&#xff1a;\u63a5\u6536\u4e00\u4e2a\u5b57\u7b26\u4e32\u5e76\u539f\u6837\u8fd4\u56de\u3002\u4e00\u4e2a\u6700\u5c0f\u5316\u7684\u8bf7\u6c42\/\u54cd\u5e94\u5de5\u5177&#xff0c;\u7528\u4e8e\u9a8c\u8bc1\u63d2\u6869\u6d41\u6c34\u7ebf\u662f\u5426\u7aef\u5230\u7aef\u6b63\u5e38\u5de5\u4f5c\u3002<\/li>\n<li>get-sum&#xff1a;\u63a5\u6536\u4e24\u4e2a\u6570\u5b57\u5e76\u8fd4\u56de\u5b83\u4eec\u7684\u548c\u3002\u4ee3\u8868\u4e00\u4e2a\u5e26\u53c2\u6570\u7684\u5de5\u5177&#xff0c;\u5e76\u5305\u542b\u7b80\u5355\u4e1a\u52a1\u903b\u8f91\u3002<\/li>\n<li>trigger-long-running-operation&#xff1a;\u542f\u52a8\u4e00\u4e2a\u9700\u8981\u6570\u79d2\u624d\u80fd\u5b8c\u6210\u7684\u591a\u6b65\u9aa4\u64cd\u4f5c\u3002\u7528\u4e8e\u6a21\u62df\u8c03\u7528\u4e0b\u6e38 API \u6216\u6267\u884c\u9ad8\u5f00\u9500\u8ba1\u7b97\u7684\u5de5\u5177\u3002<\/li>\n<\/ul>\n<p>\u6211\u4eec\u4f7f\u7528 EDOT Node.js&#xff08;&#064;elastic\/opentelemetry-node&#xff09;\u5bf9\u5b83\u8fdb\u884c\u4e86\u63d2\u6869&#xff0c;\u8fd9\u662f Elastic \u63d0\u4f9b\u7684 OpenTelemetry SDK \u53d1\u884c\u7248\u3002EDOT \u66ff\u4ee3\u4e86\u4f60\u539f\u672c\u9700\u8981\u5355\u72ec\u5b89\u88c5\u7684\u4e94\u516d\u4e2a OTel \u5305&#xff0c;\u5e76\u989d\u5916\u63d0\u4f9b\u4e86 elasticapm connector&#xff0c;\u8fd9\u662f Kibana APM UI \u6784\u5efa\u670d\u52a1\u62d3\u6251\u56fe\u3001\u4e8b\u52a1\u5206\u7ec4\u548c\u5ef6\u8fdf\u56fe\u8868\u6240\u5fc5\u9700\u7684\u3002\u5982\u679c\u6ca1\u6709\u8fd9\u4e2a connector&#xff0c;\u539f\u59cb OTLP \u6570\u636e\u867d\u7136\u4f1a\u8fdb\u5165 Elasticsearch&#xff0c;\u4f46 APM \u89c6\u56fe\u5c06\u6ca1\u6709\u53ef\u7528\u4e8e\u6784\u5efa\u7684\u6570\u636e\u3002<\/p>\n<p>\u6574\u4f53\u67b6\u6784\u5982\u4e0b&#xff1a;<\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"887\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260725215718-6a65313e994f7.webp\" width=\"800\" \/><\/p>\n<p>\u8fd9\u5c31\u662f\u6574\u4e2a\u95ed\u73af&#xff1a;Claude \u6267\u884c\u5de5\u5177\u3001\u751f\u6210\u9065\u6d4b\u6570\u636e&#xff0c;\u7136\u540e\u518d\u901a\u8fc7\u7b2c\u4e8c\u4e2a MCP \u5206\u6790\u8fd9\u4e9b\u9065\u6d4b\u6570\u636e\u3002\u53ef\u89c2\u6d4b\u6027\u6570\u636e\u4e0d\u518d\u53ea\u662f\u9759\u9759\u5f85\u5728 dashboard \u4e2d\u7b49\u5f85\u4eba\u7c7b\u67e5\u770b\u7684\u4e1c\u897f&#xff0c;\u800c\u662f AI \u53ef\u4ee5\u4e3b\u52a8\u63a8\u7406\u7684\u4e0a\u4e0b\u6587\u3002<\/p>\n<p>\u8fd9\u4e24\u4e2a MCP \u670d\u52a1\u5668\u4f1a\u540c\u65f6\u5728 Claude Desktop \u4e2d\u8fd0\u884c\u3002\u5df2\u63d2\u6869\u7684 MCP \u8d1f\u8d23\u751f\u6210\u9065\u6d4b\u6570\u636e&#xff0c;\u800c Agent Builder MCP \u8d1f\u8d23\u8ba9\u6211\u4eec\u67e5\u8be2\u8fd9\u4e9b\u6570\u636e\u3002<\/p>\n<p>\u4e3a\u4e86\u8ba9 Claude Desktop \u540c\u65f6\u8fde\u63a5\u5230\u8fd9\u4e24\u4e2a\u670d\u52a1\u5668&#xff0c;claude_desktop_config.json \u914d\u7f6e\u5982\u4e0b&#xff1a;<\/p>\n<p>{<br \/>\n  &#034;mcpServers&#034;: {<br \/>\n    &#034;everything&#034;: {<br \/>\n      &#034;command&#034;: &#034;node&#034;,<br \/>\n      &#034;args&#034;: [<br \/>\n        &#034;&#8211;import&#034;,<br \/>\n        &#034;\/path\/to\/node_modules\/&#064;elastic\/opentelemetry-node\/import.mjs&#034;,<br \/>\n        &#034;\/path\/to\/everything\/dist\/index.js&#034;,<br \/>\n        &#034;stdio&#034;<br \/>\n      ],<br \/>\n      &#034;env&#034;: {<br \/>\n        &#034;OTEL_SERVICE_NAME&#034;: &#034;everything-mcp-server&#034;,<br \/>\n        &#034;OTEL_EXPORTER_OTLP_ENDPOINT&#034;: &#034;https:\/\/&lt;your-otlp-endpoint&gt;&#034;,<br \/>\n        &#034;OTEL_EXPORTER_OTLP_HEADERS&#034;: &#034;Authorization&#061;ApiKey &lt;your-api-key&gt;&#034;,<br \/>\n        &#034;OTEL_LOG_LEVEL&#034;: &#034;none&#034;<br \/>\n      }<br \/>\n    },<br \/>\n    &#034;elastic-agent-builder&#034;: {<br \/>\n      &#034;command&#034;: &#034;npx&#034;,<br \/>\n      &#034;args&#034;: [<br \/>\n        &#034;mcp-remote&#034;,<br \/>\n        &#034;https:\/\/&lt;your-kibana-url&gt;\/api\/agent_builder\/mcp&#034;,<br \/>\n        &#034;&#8211;header&#034;,<br \/>\n        &#034;Authorization:ApiKey &lt;your-api-key&gt;&#034;<br \/>\n      ]<br \/>\n    }<br \/>\n  }<br \/>\n}<\/p>\n<p>&#8211;import \/path\/to\/&#064;elastic\/opentelemetry-node\/import.mjs \u6807\u5fd7\u5c31\u662f\u5b9e\u73b0\u96f6\u4ee3\u7801\u81ea\u52a8\u63d2\u6869\u6240\u9700\u7684\u5168\u90e8\u5185\u5bb9\u3002\u4f46\u81ea\u52a8\u63d2\u6869\u53ea\u80fd\u6355\u83b7 HTTP \u8c03\u7528\u3001\u6570\u636e\u5e93\u67e5\u8be2\u4ee5\u53ca\u5176\u4ed6 Node.js \u5df2\u652f\u6301\u63d2\u6869\u7684\u5e93\u3002MCP \u5de5\u5177\u8c03\u7528\u5c5e\u4e8e\u5e94\u7528\u903b\u8f91&#xff0c;\u800c\u5e94\u7528\u903b\u8f91\u9700\u8981\u624b\u52a8 spans\u3002<\/p>\n<\/p>\n<h2>MCP \u5de5\u5177\u8c03\u7528\u4f1a\u751f\u6210\u4ec0\u4e48 traces<\/h2>\n<p>OpenTelemetry \u89c4\u8303\u5df2\u7ecf\u5305\u542b\u4e86 MCP \u7684\u5b98\u65b9\u8bed\u4e49\u7ea6\u5b9a&#xff08; semantic conventions &#xff09;\u3002\u9075\u5faa\u8fd9\u4e9b\u7ea6\u5b9a\u610f\u5473\u7740\u4f60\u7684 traces \u5728\u4e0d\u540c\u5de5\u5177\u548c\u56e2\u961f\u4e4b\u95f4\u5177\u6709\u4e00\u81f4\u6027\u3001\u53ef\u4ee5\u6309\u540d\u79f0\u641c\u7d22&#xff0c;\u5e76\u517c\u5bb9\u4efb\u4f55\u652f\u6301 OTel \u7684\u540e\u7aef&#xff0c;\u5305\u62ec Elastic APM\u3002<\/p>\n<p>span \u547d\u540d\u9075\u5faa {mcp.method.name} {target} \u6a21\u5f0f\u3002\u5bf9\u4e8e\u5de5\u5177\u8c03\u7528&#xff0c;\u8fd9\u4f1a\u53d8\u6210 tools\/call echo \u6216 tools\/call get-sum \u3002\u8fd9\u4e5f\u662f\u4f60\u5728 Kibana APM \u4e2d\u770b\u5230\u7684 transaction \u540d\u79f0\u3002<\/p>\n<p>\u6bcf\u4e2a span \u4e0a\u7684\u5173\u952e attributes&#xff1a;<\/p>\n<table>\n<tr>AttributeValuePurpose<\/tr>\n<tbody>\n<tr>\n<td>mcp.method.name<\/td>\n<td>tools\/call<\/td>\n<td>MCP \u534f\u8bae\u65b9\u6cd5<\/td>\n<\/tr>\n<tr>\n<td>gen_ai.tool.name<\/td>\n<td>echo<\/td>\n<td>\u88ab\u8c03\u7528\u7684\u5177\u4f53\u5de5\u5177<\/td>\n<\/tr>\n<tr>\n<td>gen_ai.operation.name<\/td>\n<td>execute_tool<\/td>\n<td>GenAI \u8bed\u4e49\u7ea6\u5b9a<\/td>\n<\/tr>\n<tr>\n<td>error.type<\/td>\n<td>\u9519\u8bef\u7c7b\u540d<\/td>\n<td>\u4ec5\u5728\u5931\u8d25\u65f6\u8bbe\u7f6e<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u7528\u4e8e\u521b\u5efa\u8fd9\u4e9b spans \u7684 wrapper \u6a21\u5f0f\u5982\u4e0b\u6240\u793a&#xff1a;<\/p>\n<p>const tracer &#061; trace.getTracer(&#039;everything-mcp-server&#039;, &#039;1.0.0&#039;);<\/p>\n<p>function withToolSpan(toolName, fn) {<br \/>\n  return tracer.startActiveSpan(&#096;tools\/call ${toolName}&#096;, (span) &#061;&gt; {<br \/>\n    span.setAttribute(&#039;mcp.method.name&#039;, &#039;tools\/call&#039;);<br \/>\n    span.setAttribute(&#039;gen_ai.tool.name&#039;, toolName);<br \/>\n    span.setAttribute(&#039;gen_ai.operation.name&#039;, &#039;execute_tool&#039;);<\/p>\n<p>    try {<br \/>\n      const result &#061; fn();<br \/>\n      span.end();<br \/>\n      return result;<br \/>\n    } catch (err) {<br \/>\n      span.recordException(err);<br \/>\n      span.setStatus({ code: SpanStatusCode.ERROR, message: err.message });<br \/>\n      span.setAttribute(&#039;error.type&#039;, err.constructor.name);<br \/>\n      span.end();<br \/>\n      throw err;<br \/>\n    }<br \/>\n  });<br \/>\n}<\/p>\n<p>\u6bcf\u4e2a tool handler \u90fd\u4f1a\u7528 withToolSpan \u5305\u88f9\u5176\u903b\u8f91\u3002\u7ed3\u679c\u662f\u5728 Elastic APM \u4e2d\u4e3a\u6bcf\u4e00\u6b21\u5de5\u5177\u8c03\u7528\u751f\u6210\u4e00\u4e2a\u5df2\u547d\u540d\u7684 span&#xff0c;\u5176\u4e2d\u5305\u542b\u6301\u7eed\u65f6\u95f4\u3001\u72b6\u6001\u4ee5\u53ca\u9519\u8bef\u4fe1\u606f\u7b49\u3002<\/p>\n<p>\u5b89\u5168\u6ce8\u610f\u4e8b\u9879&#xff1a;OTel \u89c4\u8303\u5b9a\u4e49\u4e86\u4e24\u4e2a\u7528\u4e8e\u5de5\u5177\u8c03\u7528\u7684\u53ef\u9009\u5c5e\u6027&#xff1a;gen_ai.tool.call.arguments \u548c gen_ai.tool.call.result\u3002\u8fd9\u4e24\u4e2a\u5b57\u6bb5\u90fd\u53ef\u80fd\u5305\u542b\u654f\u611f\u6570\u636e&#xff0c;\u56e0\u6b64\u88ab\u6807\u8bb0\u4e3a\u6f5c\u5728\u98ce\u9669\u5b57\u6bb5\u3002\u4ee5 everything server \u4e2d\u7684 get-env \u5de5\u5177\u4e3a\u4f8b&#xff0c;\u5b83\u4f1a\u8fd4\u56de\u6240\u6709\u73af\u5883\u53d8\u91cf&#xff0c;\u5176\u4e2d\u53ef\u80fd\u5305\u542b API key \u548c\u51ed\u8bc1\u3002\u56e0\u6b64&#xff0c;\u53ea\u6709\u5728\u786e\u8ba4\u6570\u636e\u53ef\u4ee5\u5b89\u5168\u5b58\u50a8\u5728\u53ef\u89c2\u6d4b\u6027\u540e\u7aef\u65f6&#xff0c;\u624d\u5e94\u91c7\u96c6\u8fd9\u4e9b\u5c5e\u6027&#xff0c;\u5e76\u5efa\u8bae\u5728 SDK \u5c42\u8fdb\u884c\u8131\u654f\u6216\u8fc7\u6ee4\u540e\u518d\u5bfc\u51fa\u3002<\/p>\n<\/p>\n<h2>Kibana APM&#xff1a;\u67e5\u770b MCP \u670d\u52a1\u5668\u6027\u80fd<\/h2>\n<p>\u5728\u914d\u7f6e\u597d Claude Desktop \u5e76\u542f\u52a8\u4e24\u4e2a MCP \u4e4b\u540e&#xff0c;\u89e6\u53d1\u51e0\u6b21\u5de5\u5177\u8c03\u7528\u540e&#xff0c;everything-mcp-server \u670d\u52a1\u4f1a\u51fa\u73b0\u5728 Kibana \u7684 Observability &gt; Applications &gt; Services Inventory \u4e2d&#xff1a;<\/p>\n<p style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260725215718-6a65313e9ff12.webp\" \/><\/p>\n<\/p>\n<h3>Transactions \u89c6\u56fe<\/h3>\n<p>Kibana \u4f1a\u6309\u7167 transaction \u540d\u79f0\u5bf9 traces \u8fdb\u884c\u5206\u7ec4\u3002\u7531\u4e8e\u6211\u4eec\u9075\u5faa\u8bed\u4e49\u7ea6\u5b9a&#xff0c;\u6bcf\u4e2a\u5de5\u5177\u90fd\u4f1a\u62e5\u6709\u81ea\u5df1\u7684\u4e00\u884c&#xff1a;tools\/call echo\u3001tools\/call get-sum\u3001tools\/call trigger-long-running-operation\u3002\u4f60\u53ef\u4ee5\u65e0\u9700\u4efb\u4f55\u914d\u7f6e&#xff0c;\u76f4\u63a5\u770b\u5230\u6bcf\u4e2a\u5de5\u5177\u7684\u5ef6\u8fdf\u3001\u541e\u5410\u91cf\u548c\u9519\u8bef\u7387\u3002<\/p>\n<p>\u8fd9\u6b63\u662f\u7edf\u4e00 span \u547d\u540d\u4ef7\u503c\u4f53\u73b0\u7684\u5730\u65b9\u3002\u5982\u679c\u6709\u4e94\u4e2a\u4e0d\u540c\u5f00\u53d1\u8005\u5728 MCP \u670d\u52a1\u5668\u4e2d\u6dfb\u52a0\u5de5\u5177&#xff0c;\u5e76\u4e14\u5927\u5bb6\u90fd\u9075\u5faa tools\/call {toolName} \u7684\u89c4\u8303&#xff0c;APM UI \u5c31\u4f1a\u81ea\u52a8\u4fdd\u6301\u6574\u6d01\u6709\u5e8f\u3002<\/p>\n<\/p>\n<h3>Trace waterfall&#xff08;\u8c03\u7528\u94fe\u7011\u5e03\u56fe&#xff09;<\/h3>\n<p>\u70b9\u51fb\u67d0\u4e2a\u5177\u4f53 trace \u540e\u4f1a\u8fdb\u5165 waterfall \u89c6\u56fe\u3002\u5bf9\u4e8e\u5355\u4e2a\u5de5\u5177\u8c03\u7528\u6765\u8bf4&#xff0c;\u8fd9\u4e2a\u7ed3\u6784\u975e\u5e38\u7b80\u5355&#xff1a;\u4e00\u4e2a span \u8986\u76d6\u6574\u4e2a\u6267\u884c\u8fc7\u7a0b\u3002\u5982\u679c\u4f60\u7684 tool handler \u8c03\u7528\u4e86\u4e0b\u6e38 HTTP \u8bf7\u6c42\u6216\u6570\u636e\u5e93\u67e5\u8be2&#xff08;\u8fd9\u4e9b\u901a\u5e38\u4f1a\u88ab\u81ea\u52a8\u63d2\u6869&#xff09;&#xff0c;\u5b83\u4eec\u4f1a\u4f5c\u4e3a\u5b50 spans \u663e\u793a\u51fa\u6765\u3002\u4f60\u53ef\u4ee5\u6e05\u6670\u770b\u5230\u65f6\u95f4\u6d88\u8017\u662f\u5728\u4e1a\u52a1\u903b\u8f91\u4e2d&#xff0c;\u8fd8\u662f\u5728\u7b49\u5f85\u5916\u90e8\u8c03\u7528\u3002<\/p>\n<\/p>\n<h3>\u5ef6\u8fdf\u5206\u5e03&#xff08;Latency distribution&#xff09;<\/h3>\n<p>\u5ef6\u8fdf\u56fe\u5c55\u793a\u4e86 p50\u3001p95 \u548c p99 \u7684\u5206\u5e03\u60c5\u51b5&#xff0c;\u8986\u76d6\u67d0\u4e2a\u5de5\u5177\u7684\u6240\u6709\u6267\u884c\u8bb0\u5f55\u3002\u8fd9\u4f7f\u4f60\u80fd\u591f\u8f7b\u677e\u533a\u5206\u201c\u7a33\u5b9a\u5feb\u901f\u201d\u7684\u5de5\u5177\u548c\u201c\u5076\u53d1\u6162\u8bf7\u6c42\u201d\u7684\u5de5\u5177\u3002\u4f8b\u5982 trigger-long-running-operation \u4f1a\u6839\u636e\u6267\u884c\u6b65\u9aa4\u6570\u91cf\u663e\u793a\u8f83\u5bbd\u7684\u5206\u5e03&#xff0c;\u8fd9\u662f\u5728\u8bbe\u7f6e\u544a\u8b66\u524d\u7406\u89e3\u9884\u671f\u6267\u884c\u65f6\u95f4\u8303\u56f4\u7684\u6709\u6548\u57fa\u7ebf\u3002<\/p>\n<\/p>\n<h3>\u9519\u8bef\u8ffd\u8e2a&#xff08;Error tracking&#xff09;<\/h3>\n<p>\u5931\u8d25\u7684\u5de5\u5177\u8c03\u7528\u4f1a\u51fa\u73b0\u5728 Errors \u9762\u677f\u4e2d&#xff0c;\u5305\u542b\u5b8c\u6574\u5806\u6808\u3001\u5931\u8d25\u65f6\u9644\u5e26\u7684 span attributes&#xff0c;\u4ee5\u53ca\u8be5\u9519\u8bef\u53d1\u751f\u7684\u6b21\u6570\u3002\u5982\u679c\u4f60\u4f7f\u7528 span.recordException(err) \u8bb0\u5f55\u5f02\u5e38&#xff0c;Kibana \u4f1a\u5c06\u8be5\u9519\u8bef\u76f4\u63a5\u5173\u8054\u5230\u5bf9\u5e94\u7684 trace\u3002<\/p>\n<\/p>\n<h2>\u7528 Agent Builder MCP \u95ed\u73af<\/h2>\n<p>Elastic Agent Builder MCP \u5141\u8bb8 Claude \u5728\u751f\u6210 trace \u7684\u540c\u4e00\u4e2a\u804a\u5929\u4f1a\u8bdd\u4e2d&#xff0c;\u4ece Elasticsearch \u67e5\u8be2\u81ea\u5df1\u7684 trace \u6570\u636e\u3002Agent Builder MCP \u53ef\u4ee5\u67e5\u8be2 API key \u6709\u6743\u9650\u8bbf\u95ee\u7684\u4efb\u4f55 Elasticsearch \u7d22\u5f15&#xff0c;\u800c APM traces \u5b58\u50a8\u5728 .ds-traces-apm.otel-default-* \u4e2d\u3002\u4e3a Agent Builder API key \u6388\u4e88\u8fd9\u4e9b\u7d22\u5f15\u7684\u8bfb\u53d6\u6743\u9650&#xff0c;\u5c31\u5b8c\u6210\u4e86\u8fd9\u4e2a\u95ed\u73af&#xff1a;\u6267\u884c\u5de5\u5177\u8c03\u7528\u7684 agent \u73b0\u5728\u53ef\u4ee5\u53cd\u8fc7\u6765\u7406\u89e3\u8fd9\u4e9b\u8c03\u7528\u7684\u6027\u80fd\u8868\u73b0\u3002<\/p>\n<p>\u4e0b\u9762\u662f\u5b9e\u9645\u6548\u679c\u3002\u5728 Claude Desktop \u4e2d\u751f\u6210 traces&#xff0c;\u53ef\u4ee5\u8fd9\u6837\u63d0\u95ee&#xff1a;<\/p>\n<p>\u201c\u4f7f\u7528 echo \u5de5\u5177\u8bf4 hello&#xff0c;\u7136\u540e\u4f7f\u7528 get-sum \u8ba1\u7b97 1337 \u52a0 42&#xff0c;\u6700\u540e\u8fd0\u884c\u4e00\u4e2a\u5305\u542b 3 \u4e2a\u6b65\u9aa4\u7684 long-running operation\u3002\u201d<\/p>\n<p style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260725215718-6a65313ea5c23.webp\" \/><\/p>\n<p>Claude \u5728\u5df2\u63d2\u6869\u7684 MCP \u4e0a\u6267\u884c\u4e86\u4e09\u4e2a\u5de5\u5177\u8c03\u7528\u3002\u4e09\u4e2a spans \u88ab\u5199\u5165 Elastic APM\u3002<\/p>\n<p>\u73b0\u5728&#xff0c;\u4e0d\u79bb\u5f00\u804a\u5929\u7a97\u53e3&#xff0c;\u6211\u4eec\u5c1d\u8bd5\u67e5\u8be2\u8fd9\u4e9b traces&#xff0c;\u53ef\u4ee5\u8fd9\u6837\u63d0\u95ee&#xff1a;<\/p>\n<p>\u201c\u641c\u7d22\u8fc7\u53bb 10 \u5206\u949f\u7684 APM trace \u6570\u636e\u3002\u505a\u4e86\u54ea\u4e9b\u5de5\u5177\u8c03\u7528&#xff1f;\u6bcf\u4e2a\u8c03\u7528\u8017\u65f6\u591a\u5c11&#xff1f;\u201d<\/p>\n<p style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260725215718-6a65313eaca7b.webp\" \/><\/p>\n<p>\u6211\u4eec\u53ef\u4ee5\u7528\u670d\u52a1\u6570\u636e\u6765\u8fdb\u884c\u9a8c\u8bc1&#xff1a;<\/p>\n<p style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260725215718-6a65313eb2490.webp\" \/><\/p>\n<p>\u4f60\u53ef\u4ee5\u7ee7\u7eed\u7528\u670d\u52a1\u6570\u636e\u6765\u9a8c\u8bc1\u8fd9\u4e00\u70b9&#xff1a;<\/p>\n<p>Claude \u4f1a\u901a\u8fc7 Agent Builder MCP \u5728 traces index \u4e0a\u6267\u884c\u67e5\u8be2\u3002\u5b83\u8fd4\u56de\u771f\u5b9e trace \u6570\u636e\u4e2d\u7684\u5de5\u5177\u540d\u79f0\u3001\u6301\u7eed\u65f6\u95f4\u548c\u72b6\u6001&#xff0c;\u7136\u540e\u7528\u81ea\u7136\u8bed\u8a00\u7efc\u5408\u751f\u6210\u7b54\u6848\u3002<\/p>\n<p>\u4f60\u53ef\u4ee5\u8fdb\u4e00\u6b65\u63d0\u95ee&#xff0c;\u4f8b\u5982&#xff1a;<\/p>\n<ul>\n<li>\u201c\u8fd9\u4e9b\u5de5\u5177\u8c03\u7528\u4e2d\u54ea\u4e2a\u7684 p95 \u5ef6\u8fdf\u6700\u9ad8&#xff1f;\u201d<\/li>\n<li>\u201c\u6709\u6ca1\u6709\u5de5\u5177\u8c03\u7528\u5931\u8d25&#xff1f;\u5982\u679c\u6709&#xff0c;\u9519\u8bef\u4fe1\u606f\u662f\u4ec0\u4e48&#xff1f;\u201d<\/li>\n<li>\u201c\u6bd4\u8f83 echo \u5de5\u5177\u548c get-sum \u5728\u8fc7\u53bb\u4e00\u5c0f\u65f6\u5185\u7684\u5ef6\u8fdf\u5dee\u5f02\u3002\u201d<\/li>\n<\/ul>\n<p>\u8fd9\u4e9b\u95ee\u9898\u90fd\u4f1a\u901a\u8fc7 Agent Builder \u7684 platform.core.execute_esql \u5de5\u5177\u8f6c\u6362\u4e3a ES|QL \u67e5\u8be2&#xff0c;\u5e76\u5728 APM trace \u7d22\u5f15\u4e0a\u6267\u884c\u3002<\/p>\n<\/p>\n<h2>\u4e3a\u4ec0\u4e48\u9009\u62e9 Elastic \u505a MCP \u53ef\u89c2\u6d4b\u6027<\/h2>\n<p>Agent Builder \u5b9e\u73b0\u4e86\u95ed\u73af&#xff1a;\u8fd9\u662f Elastic \u751f\u6001\u4e2d\u7279\u6709\u7684\u80fd\u529b\u3002\u7531\u4e8e APM \u6570\u636e\u5b58\u50a8\u5728 Elasticsearch \u4e2d&#xff0c;\u800c Elasticsearch \u53c8\u53ef\u4ee5\u901a\u8fc7 Agent Builder MCP \u76f4\u63a5\u67e5\u8be2&#xff0c;\u56e0\u6b64\u4f60\u53ef\u4ee5\u628a AI agent \u81ea\u5df1\u7684\u53ef\u89c2\u6d4b\u6570\u636e\u5e26\u56de\u5bf9\u8bdd\u4e2d\u3002\u4f60\u7684 AI \u53ef\u4ee5\u53cd\u601d\u81ea\u8eab\u6027\u80fd\u5e76\u8bc6\u522b\u5f02\u5e38\u3002<\/p>\n<p>\u4e3a\u5206\u5e03\u5f0f\u8ffd\u8e2a\u8bbe\u8ba1\u7684 APM UI&#xff1a;Kibana \u7684 APM \u754c\u9762\u4e13\u4e3a\u8fd9\u7c7b\u6570\u636e\u8bbe\u8ba1&#xff0c;\u5305\u62ec\u547d\u540d transactions\u3001trace waterfall\u3001\u5ef6\u8fdf\u767e\u5206\u4f4d\u3001\u5e26 stack trace \u7684\u9519\u8bef\u8ffd\u8e2a\u4ee5\u53ca\u670d\u52a1\u62d3\u6251\u56fe\u3002<\/p>\n<p>\u6258\u7ba1 OTLP \u7aef\u70b9&#xff1a;Elastic APM \u4ece Elastic 8.x \u8d77\u76f4\u63a5\u652f\u6301 OTLP\u3002\u4f60\u53ea\u9700\u5c06 OTEL_EXPORTER_OTLP_ENDPOINT \u6307\u5411 APM server \u5373\u53ef\u4f7f\u7528\u3002<\/p>\n<p>EDOT \u7b80\u5316\u914d\u7f6e&#xff1a;\u5185\u7f6e elasticapm connector&#xff0c;\u8fd9\u610f\u5473\u7740 APM UI \u53ef\u4ee5\u65e0\u9700\u989d\u5916\u914d\u7f6e\u76f4\u63a5\u5de5\u4f5c\u3002<\/p>\n<\/p>\n<h2>\u7ed3\u8bba<\/h2>\n<p>MCP \u670d\u52a1\u5668\u4e0d\u9700\u8981\u7279\u6b8a\u7684\u53ef\u89c2\u6d4b\u6027\u5de5\u5177\u3002\u5b83\u4eec\u672c\u8d28\u4e0a\u662f\u7a0b\u5e8f\u5316\u8fdb\u7a0b&#xff0c;\u800c OpenTelemetry \u6b63\u662f\u4e3a\u8fdb\u7a0b\u8bbe\u8ba1\u7684\u6807\u51c6 instrumentation \u65b9\u5f0f\u3002OTel MCP \u8bed\u4e49\u7ea6\u5b9a\u662f\u7a33\u5b9a\u7684&#xff0c;\u5e76\u63d0\u4f9b\u4e86\u4e00\u5957\u53ef\u5728\u5de5\u5177\u548c\u56e2\u961f\u95f4\u6269\u5c55\u7684\u4e00\u81f4\u547d\u540d\u89c4\u8303\u3002<\/p>\n<p>Elastic \u65b9\u6848\u7684\u5173\u952e\u4e0d\u5728 instrumentation \u672c\u8eab&#xff0c;\u800c\u5728\u7b2c\u4e8c\u4e2a MCP\u3002\u5f53\u4f60\u7684\u53ef\u89c2\u6d4b\u6570\u636e\u5b58\u50a8\u5728 Elasticsearch \u4e2d\u65f6&#xff0c;\u4f60\u53ef\u4ee5\u5728\u540c\u4e00\u4e2a AI \u4f1a\u8bdd\u4e2d\u67e5\u8be2\u5b83\u3002\u8fd9\u79cd\u53cd\u9988\u95ed\u73af\u662f\u65b0\u7684&#xff0c;\u5b83\u5f00\u542f\u4e86\u4ec5\u9760 dashboard \u65e0\u6cd5\u5b9e\u73b0\u7684\u80fd\u529b&#xff1a;\u5b9e\u65f6\u5f02\u5e38\u5206\u6790\u3001\u81ea\u52a8\u5316\u6392\u969c&#xff0c;\u4ee5\u53ca\u5728\u56e2\u961f\u5df2\u6709\u804a\u5929\u754c\u9762\u4e2d\u8fdb\u884c AI \u8f85\u52a9\u4e8b\u6545\u5206\u6790\u3002<\/p>\n<\/p>\n<h2>\u4e0b\u4e00\u6b65<\/h2>\n<ul>\n<li>\n<p>\u8bbe\u7f6e EDOT Node.js<\/p>\n<\/li>\n<li>\n<p>\u914d\u7f6e Elastic Agent Builder MCP<\/p>\n<\/li>\n<li>\n<p>MCP \u7684 OTel \u8bed\u4e49\u7ea6\u5b9a<\/p>\n<\/li>\n<li>\n<p>Elastic Cloud \u6258\u7ba1 OTLP \u7aef\u70b9&#xff08;\u5df2\u6b63\u5f0f\u53d1\u5e03&#xff09;<\/p>\n<\/li>\n<li>\n<p>\u4f7f\u7528 EDOT \u5bf9 Node.js \u5e94\u7528\u8fdb\u884c\u63d2\u6869<\/p>\n<\/li>\n<\/ul>\n<h2>\u5e38\u89c1\u95ee\u9898<\/h2>\n<\/p>\n<p>\u5982\u4f55\u4e3a MCP \u670d\u52a1\u5668\u6dfb\u52a0 tracing&#xff1f;\u4f7f\u7528 OpenTelemetry SDK \u5e76\u9075\u5faa\u5b98\u65b9 MCP OTel \u8bed\u4e49\u7ea6\u5b9a\u3002\u901a\u8fc7 Elastic Distribution of OpenTelemetry&#xff08;EDOT&#xff09;Node.js \u7248\u672c&#xff0c;\u4e00\u4e2a &#8211;import \u6807\u5fd7\u5373\u53ef\u542f\u7528 HTTP \u548c\u6570\u636e\u5e93\u7684\u81ea\u52a8 instrumentation\u3002\u5de5\u5177\u8c03\u7528 spans \u9700\u8981\u624b\u52a8\u6dfb\u52a0 wrapper&#xff0c;\u5e76\u8bbe\u7f6e mcp.method.name\u3001gen_ai.tool.name \u548c gen_ai.operation.name\u3002<\/p>\n<\/p>\n<p>\u4e3a\u4ec0\u4e48\u6211\u7684 MCP \u5de5\u5177\u8c03\u7528\u5f88\u6162&#xff0c;\u5982\u4f55\u5b9a\u4f4d\u74f6\u9888&#xff1f;\u6ca1\u6709 tracing \u65f6&#xff0c;MCP \u5de5\u5177\u8c03\u7528\u662f\u9ed1\u76d2&#xff1a;\u4f60\u53ea\u80fd\u770b\u5230\u7ed3\u679c&#xff0c;\u65e0\u6cd5\u77e5\u9053\u65f6\u95f4\u6d88\u8017\u5728\u54ea\u3002\u4f7f\u7528 OpenTelemetry \u5bf9\u670d\u52a1\u5668\u8fdb\u884c instrumentation&#xff0c;\u5c06 traces \u53d1\u9001\u5230 Elastic APM&#xff0c;\u5e76\u5728 Kibana \u7684 trace waterfall \u4e2d\u67e5\u770b\u4e1a\u52a1\u903b\u8f91\u4e0e\u4e0b\u6e38 HTTP \/ \u6570\u636e\u5e93\u8c03\u7528\u7684\u8017\u65f6\u5206\u5e03\u3002<\/p>\n<\/p>\n<p>\u53ef\u4ee5\u5728\u4e0d\u4f7f\u7528\u81ea\u5b9a\u4e49 collector \u7684\u60c5\u51b5\u4e0b\u53d1\u9001 MCP traces \u5230 Elastic APM \u5417&#xff1f;\u53ef\u4ee5\u3002Elastic APM \u76f4\u63a5\u652f\u6301 OTLP\u3002\u8bbe\u7f6e OTEL_EXPORTER_OTLP_ENDPOINT \u548c OTEL_EXPORTER_OTLP_HEADERS&#xff08;\u5305\u542b API key&#xff09;\u5373\u53ef\u3002EDOT \u8fd8\u5185\u7f6e elasticapm connector&#xff0c;\u7528\u4e8e\u652f\u6301 Kibana APM \u7684\u670d\u52a1\u62d3\u6251\u548c transaction \u5206\u7ec4\u3002<\/p>\n<\/p>\n<p>MCP \u5de5\u5177\u8c03\u7528\u5e94\u8be5\u4f7f\u7528\u4ec0\u4e48 span \u540d\u79f0\u548c\u5c5e\u6027&#xff1f;\u9075\u5faa OpenTelemetry MCP \u8bed\u4e49\u7ea6\u5b9a&#xff1a;span \u547d\u540d\u4e3a {mcp.method.name} {target}&#xff08;\u4f8b\u5982 tools\/call echo&#xff09;&#xff0c;\u5e76\u8bbe\u7f6e mcp.method.name\u3001gen_ai.tool.name \u548c gen_ai.operation.name&#061;execute_tool\u3002\u5931\u8d25\u65f6\u8bbe\u7f6e error.type\u3002\u7edf\u4e00\u547d\u540d\u53ef\u4ee5\u8ba9 Kibana APM \u81ea\u52a8\u6b63\u786e\u5206\u7ec4\u3002<\/p>\n<\/p>\n<p>\u8fd9\u548c Datadog \u6216 Grafana \u6709\u4ec0\u4e48\u4e0d\u540c&#xff1f;\u4efb\u4f55 OTel \u517c\u5bb9\u540e\u7aef\u90fd\u53ef\u4ee5\u63a5\u6536 traces\u3002Elastic \u7684\u533a\u522b\u5728\u4e8e Agent Builder MCP&#xff0c;\u5b83\u5141\u8bb8 AI agent \u7528\u81ea\u7136\u8bed\u8a00\u67e5\u8be2\u81ea\u5df1\u751f\u6210\u7684 traces\u3002\u8fd9\u79cd\u201cAI \u53cd\u601d\u81ea\u8eab\u6027\u80fd\u201d\u7684\u95ed\u73af\u80fd\u529b&#xff0c;\u662f\u4e0d\u901a\u8fc7 MCP \u66b4\u9732\u6570\u636e\u7684\u7cfb\u7edf\u6240\u4e0d\u5177\u5907\u7684\u3002<\/p>\n<\/p>\n<p>\u662f\u5426\u5e94\u8be5\u5728 trace \u4e2d\u8bb0\u5f55 MCP tool \u7684\u53c2\u6570\u548c\u7ed3\u679c&#xff1f;OTel \u89c4\u8303\u5c06 gen_ai.tool.call.arguments \u548c gen_ai.tool.call.result \u6807\u8bb0\u4e3a\u53ef\u9009\u5b57\u6bb5&#xff0c;\u5e76\u63d0\u793a\u53ef\u80fd\u5305\u542b\u654f\u611f\u6570\u636e\u3002\u4f8b\u5982 get-env \u5de5\u5177\u53ef\u80fd\u6cc4\u9732 API key\u3002\u53ea\u6709\u5728\u786e\u8ba4\u5b89\u5168\u65f6\u624d\u5e94\u8bb0\u5f55&#xff0c;\u5e76\u5efa\u8bae\u5728 SDK \u5c42\u8fdb\u884c\u8131\u654f\u3002<\/p>\n<\/p>\n<p>\u8fd9\u4e2a\u65b9\u6848\u662f\u5426\u652f\u6301 Node.js \u4ee5\u5916\u7684\u8bed\u8a00&#xff1f;\u652f\u6301\u3002MCP OTel \u8bed\u4e49\u662f\u8bed\u8a00\u65e0\u5173\u7684\u3002EDOT \u63d0\u4f9b Node.js\u3001Java\u3001Python\u3001.NET \u7b49\u7248\u672c&#xff0c;\u6240\u6709\u8bed\u8a00\u90fd\u53ef\u4ee5\u53d1\u9001 OTLP \u5230 Elastic APM\u3002wrapper \u6a21\u5f0f\u662f\u901a\u7528\u7684&#xff1a;\u5728 tool handler \u5916\u5305\u4e00\u5c42 span&#xff0c;\u5e76\u8bbe\u7f6e\u6807\u51c6 attributes&#xff0c;\u5728\u5931\u8d25\u65f6\u8bb0\u5f55 exception\u3002<\/p>\n<\/p>\n<p>\u539f\u6587&#xff1a;https:\/\/www.elastic.co\/observability-labs\/blog\/mcp-tracing-opentelemetry-elastic-apm<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4f5c\u8005&#xff1a;\u6765\u81ea Elastic\u00a0Jeffrey Rengifo \u4e3a MCP \u670d\u52a1\u5668\u6dfb\u52a0 OpenTelemetry \u8ffd\u8e2a&#xff0c;\u5728 Elastic APM \u4e2d\u53ef\u89c6\u5316\u5de5\u5177\u8c03\u7528\u6027\u80fd&#xff0c;\u5e76\u901a\u8fc7 Agent Builder MCP \u4ece Claude Desktop \u67e5\u8be2\u8ffd\u8e2a\u6570\u636e\u3002 MCP \u670d\u52a1\u5668\u672c\u8d28\u4e0a\u53ea\u662f\u4e00\u4e2a Node \u8fdb\u7a0b&#xff0c;\u8fd9\u610f\u5473\u7740\u53ea\u9700\u8981\u4e00\u4e2a &#8211;import \u6807\u5fd7\u5c31\u53ef\u4ee5\u542f\u7528 OpenTelemetry \u63d2\u6869\u3002\u771f\u6b63\u7684\u65b0\u53d8\u5316\u53d1\u751f\u5728\u8ffd\u8e2a\u6570\u636e\u8fdb<\/p>\n","protected":false},"author":2,"featured_media":83895,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[1299,763,323,2215,43],"topic":[],"class_list":["post-83901","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-elasticsearch","tag-763","tag-323","tag-2215","tag-43"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u5982\u4f55\u4f7f\u7528 OpenTelemetry \u548c Elastic APM \u8ffd\u8e2a MCP \u670d\u52a1\u5668\u5de5\u5177\u8c03\u7528 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/83901.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u5982\u4f55\u4f7f\u7528 OpenTelemetry \u548c Elastic APM \u8ffd\u8e2a MCP \u670d\u52a1\u5668\u5de5\u5177\u8c03\u7528 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u4f5c\u8005&#xff1a;\u6765\u81ea Elastic\u00a0Jeffrey Rengifo \u4e3a MCP \u670d\u52a1\u5668\u6dfb\u52a0 OpenTelemetry \u8ffd\u8e2a&#xff0c;\u5728 Elastic APM \u4e2d\u53ef\u89c6\u5316\u5de5\u5177\u8c03\u7528\u6027\u80fd&#xff0c;\u5e76\u901a\u8fc7 Agent Builder MCP \u4ece Claude Desktop \u67e5\u8be2\u8ffd\u8e2a\u6570\u636e\u3002 MCP \u670d\u52a1\u5668\u672c\u8d28\u4e0a\u53ea\u662f\u4e00\u4e2a Node \u8fdb\u7a0b&#xff0c;\u8fd9\u610f\u5473\u7740\u53ea\u9700\u8981\u4e00\u4e2a --import \u6807\u5fd7\u5c31\u53ef\u4ee5\u542f\u7528 OpenTelemetry \u63d2\u6869\u3002\u771f\u6b63\u7684\u65b0\u53d8\u5316\u53d1\u751f\u5728\u8ffd\u8e2a\u6570\u636e\u8fdb\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/83901.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-07-25T21:57:19+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260725215717-6a65313de2fc1.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/83901.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/83901.html\",\"name\":\"\u5982\u4f55\u4f7f\u7528 OpenTelemetry \u548c Elastic APM \u8ffd\u8e2a MCP \u670d\u52a1\u5668\u5de5\u5177\u8c03\u7528 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-07-25T21:57:19+00:00\",\"dateModified\":\"2026-07-25T21:57:19+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/83901.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/83901.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/83901.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u5982\u4f55\u4f7f\u7528 OpenTelemetry \u548c Elastic APM \u8ffd\u8e2a MCP \u670d\u52a1\u5668\u5de5\u5177\u8c03\u7528\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u5982\u4f55\u4f7f\u7528 OpenTelemetry \u548c Elastic APM \u8ffd\u8e2a MCP \u670d\u52a1\u5668\u5de5\u5177\u8c03\u7528 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/83901.html","og_locale":"zh_CN","og_type":"article","og_title":"\u5982\u4f55\u4f7f\u7528 OpenTelemetry \u548c Elastic APM \u8ffd\u8e2a MCP \u670d\u52a1\u5668\u5de5\u5177\u8c03\u7528 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u4f5c\u8005&#xff1a;\u6765\u81ea Elastic\u00a0Jeffrey Rengifo \u4e3a MCP \u670d\u52a1\u5668\u6dfb\u52a0 OpenTelemetry \u8ffd\u8e2a&#xff0c;\u5728 Elastic APM \u4e2d\u53ef\u89c6\u5316\u5de5\u5177\u8c03\u7528\u6027\u80fd&#xff0c;\u5e76\u901a\u8fc7 Agent Builder MCP \u4ece Claude Desktop \u67e5\u8be2\u8ffd\u8e2a\u6570\u636e\u3002 MCP \u670d\u52a1\u5668\u672c\u8d28\u4e0a\u53ea\u662f\u4e00\u4e2a Node \u8fdb\u7a0b&#xff0c;\u8fd9\u610f\u5473\u7740\u53ea\u9700\u8981\u4e00\u4e2a --import \u6807\u5fd7\u5c31\u53ef\u4ee5\u542f\u7528 OpenTelemetry \u63d2\u6869\u3002\u771f\u6b63\u7684\u65b0\u53d8\u5316\u53d1\u751f\u5728\u8ffd\u8e2a\u6570\u636e\u8fdb","og_url":"https:\/\/www.wsisp.com\/helps\/83901.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-07-25T21:57:19+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260725215717-6a65313de2fc1.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"5 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/83901.html","url":"https:\/\/www.wsisp.com\/helps\/83901.html","name":"\u5982\u4f55\u4f7f\u7528 OpenTelemetry \u548c Elastic APM \u8ffd\u8e2a MCP \u670d\u52a1\u5668\u5de5\u5177\u8c03\u7528 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-07-25T21:57:19+00:00","dateModified":"2026-07-25T21:57:19+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/83901.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/83901.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/83901.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u5982\u4f55\u4f7f\u7528 OpenTelemetry \u548c Elastic APM \u8ffd\u8e2a MCP \u670d\u52a1\u5668\u5de5\u5177\u8c03\u7528"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/83901","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=83901"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/83901\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/83895"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=83901"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=83901"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=83901"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=83901"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}