mirror of
https://github.com/bendtherules/ask262.git
synced 2026-08-18 13:21:55 +00:00
feat(langfuse): filter out non-tool-call spans from export
This commit is contained in:
@@ -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;
|
||||
},
|
||||
}),
|
||||
],
|
||||
});
|
||||
|
||||
@@ -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, {
|
||||
|
||||
Reference in New Issue
Block a user