mirror of
https://github.com/bendtherules/ask262.git
synced 2026-08-18 21:31:46 +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({
|
provider = new NodeTracerProvider({
|
||||||
spanProcessors: [
|
spanProcessors: [
|
||||||
new LangfuseSpanProcessor({
|
new LangfuseSpanProcessor({
|
||||||
// Export all spans, not just LLM-relevant ones
|
// Only export tool-call spans, skip health checks and protocol noise
|
||||||
shouldExportSpan: () => true,
|
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,
|
method: c.req.method,
|
||||||
client_ip: clientIp,
|
client_ip: clientIp,
|
||||||
|
mcp_method: mcpInfo.method ?? "",
|
||||||
},
|
},
|
||||||
async () => {
|
async () => {
|
||||||
const op = log.start(LogOperation.HANDLING_MCP_HTTP_REQUEST, {
|
const op = log.start(LogOperation.HANDLING_MCP_HTTP_REQUEST, {
|
||||||
|
|||||||
Reference in New Issue
Block a user