This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/main by this push:
new 47844a5828be CAMEL-23709: Remove span collapsing hack from TUI now
that core tracer skips redundant PROCESS spans (#23861)
47844a5828be is described below
commit 47844a5828be53d0fd9d186b3e9e4028a3e80ccc
Author: Claus Ibsen <[email protected]>
AuthorDate: Mon Jun 8 17:07:43 2026 +0200
CAMEL-23709: Remove span collapsing hack from TUI now that core tracer
skips redundant PROCESS spans (#23861)
Signed-off-by: Claus Ibsen <[email protected]>
Co-authored-by: Claude Opus 4.6 <[email protected]>
---
.../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);