diff --git a/src/lib/langfuse-transport.ts b/src/lib/langfuse-transport.ts index ac85b68..23663e4 100644 --- a/src/lib/langfuse-transport.ts +++ b/src/lib/langfuse-transport.ts @@ -65,8 +65,12 @@ export function initializeLangfuseTransport(): void { provider = new NodeTracerProvider({ spanProcessors: [ new LangfuseSpanProcessor({ - // Export all spans, not just LLM-relevant ones - shouldExportSpan: () => true, + // Only export tool-call spans, skip health checks and protocol noise + shouldExportSpan: (span) => { + const mcpMethod = span.otelSpan.attributes["mcp_method"]; + if (mcpMethod === "tools/call") return true; + return !mcpMethod; + }, }), ], }); diff --git a/src/mcp-server-http.ts b/src/mcp-server-http.ts index 4860863..b799bfc 100644 --- a/src/mcp-server-http.ts +++ b/src/mcp-server-http.ts @@ -329,6 +329,7 @@ export async function main() { }), method: c.req.method, client_ip: clientIp, + mcp_method: mcpInfo.method ?? "", }, async () => { const op = log.start(LogOperation.HANDLING_MCP_HTTP_REQUEST, {