From 32995ff949084a454475bb7d59d9513df58be22e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Tailland?= Date: Thu, 27 Aug 2026 13:42:10 +0200 Subject: [PATCH] Hide framework plumbing in the trace view by default MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A chat transaction is 212 spans, and almost all of them are Express middleware, mongoose and mongodb calls, kong.dns lookups and raw SQL. The flow — LibreChat to the gateway to the backend — is buried in it. Set a default span filter on the panel: spanNameOperator "!~" against those names with matchesOnly, so the view opens on the spans that describe the exchange. "Show all spans" and clearing the filter both bring them back. Deliberately a display filter, not a source change. The spans are still produced and still stored; only this panel's default view is quieter. It is also the only lever that covers the LibreChat ones: LibreChat does not use auto-instrumentations-node — it registers express, mongodb and mongoose individually in its own code — so no environment variable disables them, and they are the bulk of the 212. The option names were checked against Grafana's own traces panel bundle rather than assumed: spanName, spanNameOperator, serviceName, serviceNameOperator, matchesOnly and criticalPathOnly all exist there, and "!~" is among the operators it offers. Co-Authored-By: Claude Opus 5 --- .../dashboards/obs-distributed-traces.json | 23 +++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/k8s/grafana/dashboards/obs-distributed-traces.json b/k8s/grafana/dashboards/obs-distributed-traces.json index 0b0e739..4c0b5e6 100644 --- a/k8s/grafana/dashboards/obs-distributed-traces.json +++ b/k8s/grafana/dashboards/obs-distributed-traces.json @@ -170,7 +170,7 @@ { "type": "traces", "title": "Trace $traceId", - "description": "Grafana's own trace view: the full waterfall, every span nested in order, across LibreChat, Keycloak, the Kong gateways and the backend — no split between HTTP hops and plugins, they are one tree.\n\nClick a span to expand its attributes: method, route, status, durations, and whatever the instrumentation attached. From a span, 'Logs for this span' jumps to Loki.", + "description": "Grafana's own trace view: every span nested in order across LibreChat, Keycloak, the Kong gateways and the backend. Click a span to expand its attributes; from a span, 'Logs for this span' jumps to Loki.\n\nA default span filter hides the framework plumbing — Express middleware, mongoose/mongodb calls, kong.dns, raw SQL — which is most of a 212-span trace and none of the flow. Clear the filter in the panel, or toggle 'Show all spans', to get them back.\n\nThis is a DISPLAY filter: those spans are still produced and still stored in Tempo.", "datasource": { "type": "tempo", "uid": "tempo" @@ -192,7 +192,26 @@ "query": "$traceId", "limit": 300 } - ] + ], + "options": { + "spanFilters": { + "spanName": "middleware - .*|mongoose\\..*|mongodb\\..*|kong\\.dns|SELECT|INSERT|UPDATE|DELETE|router - .*", + "spanNameOperator": "!~", + "serviceName": "", + "serviceNameOperator": "=", + "from": "", + "to": "", + "tags": [ + { + "id": "1", + "operator": "=" + } + ], + "matchesOnly": true, + "criticalPathOnly": false, + "query": "" + } + } }, { "type": "row",