You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2026/06/08 14:19:51 UTC
(camel) branch fix/CAMEL-23709-cleanup created (now c4e87c538892)
This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a change to branch fix/CAMEL-23709-cleanup
in repository https://gitbox.apache.org/repos/asf/camel.git
at c4e87c538892 CAMEL-23709: Remove span collapsing hack from TUI now that core tracer skips redundant PROCESS spans
This branch includes the following new commits:
new c4e87c538892 CAMEL-23709: Remove span collapsing hack from TUI now that core tracer skips redundant PROCESS spans
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
(camel) 01/01: CAMEL-23709: Remove span collapsing hack from TUI now that core tracer skips redundant PROCESS spans
Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch fix/CAMEL-23709-cleanup
in repository https://gitbox.apache.org/repos/asf/camel.git
commit c4e87c5388929bbbd838318d0cc70670e936006b
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Mon Jun 8 16:19:37 2026 +0200
CAMEL-23709: Remove span collapsing hack from TUI now that core tracer skips redundant PROCESS spans
Co-Authored-By: Claude Opus 4.6 <no...@anthropic.com>
Signed-off-by: Claus Ibsen <cl...@gmail.com>
---
.../dsl/jbang/core/commands/tui/SpansTab.java | 45 ++++------------------
1 file changed, 7 insertions(+), 38 deletions(-)
diff --git a/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/SpansTab.java b/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/SpansTab.java
index be861745cd23..065da540a47a 100644
--- a/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/SpansTab.java
+++ b/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/SpansTab.java
@@ -677,13 +677,8 @@ class SpansTab implements MonitorTab {
sb.append(ts.remoteComponents);
}
ts.searchText = sb.toString().toLowerCase();
- // Count effective spans (exclude EVENT_PROCESS which are collapsed in waterfall)
- for (SpanEntry s : traceSpans) {
- if (!isEventProcess(s)) {
- ts.spanCount++;
- }
- }
- ts.maxDepth = computeEffectiveDepth(traceSpans);
+ ts.spanCount = traceSpans.size();
+ ts.maxDepth = computeMaxDepth(traceSpans);
}
result.sort((a, b) -> {
int cmp = sortTrace(a, b, currentSpans);
@@ -770,14 +765,6 @@ class SpansTab implements MonitorTab {
addToWaterfall(result, children.get(0), childrenMap, depth, included, spanIdToDepth);
return;
}
- // Collapse processor+send pairs:
- // When an EVENT_PROCESS span (e.g. to4-to) has a single EVENT_SENT child,
- // skip the processor wrapper and show only the send span.
- if (isEventProcess(span) && !span.isError() && children != null && children.size() == 1
- && isEventSent(children.get(0))) {
- addToWaterfall(result, children.get(0), childrenMap, depth, included, spanIdToDepth);
- return;
- }
// Hide processor spans when toggle is off — promote children to same depth
// Keep error processors visible so errors aren't hidden
if (!showProcessors && !span.isError() && isEventProcess(span)) {
@@ -904,35 +891,17 @@ class SpansTab implements MonitorTab {
return Style.EMPTY.fg(Color.YELLOW).bold();
}
- private static int computeEffectiveDepth(List<SpanEntry> traceSpans) {
- // Build parent-child tree excluding EVENT_PROCESS spans
+ private static int computeMaxDepth(List<SpanEntry> traceSpans) {
Map<String, String> parentMap = new HashMap<>();
- Set<String> nonProcessIds = new HashSet<>();
for (SpanEntry s : traceSpans) {
- if (!isEventProcess(s)) {
- nonProcessIds.add(s.spanId());
- // Walk up to find nearest non-process parent
- String parentId = s.parentSpanId();
- while (parentId != null && !nonProcessIds.contains(parentId)) {
- String nextParent = null;
- for (SpanEntry p : traceSpans) {
- if (p.spanId().equals(parentId)) {
- nextParent = p.parentSpanId();
- break;
- }
- }
- parentId = nextParent;
- }
- if (parentId != null) {
- parentMap.put(s.spanId(), parentId);
- }
+ if (s.parentSpanId() != null && !s.parentSpanId().isEmpty()) {
+ parentMap.put(s.spanId(), s.parentSpanId());
}
}
- // Compute max depth from the effective tree
int maxDepth = 0;
- for (String id : nonProcessIds) {
+ for (SpanEntry s : traceSpans) {
int depth = 0;
- String cur = id;
+ String cur = s.spanId();
while (parentMap.containsKey(cur)) {
depth++;
cur = parentMap.get(cur);