This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch ih
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 97a2d49fdd4d74a4e039b5186fd33ede352ae953
Author: Claus Ibsen <[email protected]>
AuthorDate: Sun Nov 23 17:28:22 2025 +0100

    CAMEL-22693: Mark up EIP and endpoint headers that are of importance to 
make tooling, trouble shooting and development easier.
---
 .../core/commands/action/CamelHistoryAction.java   | 26 ++++++++++++++++++++--
 1 file changed, 24 insertions(+), 2 deletions(-)

diff --git 
a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/action/CamelHistoryAction.java
 
b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/action/CamelHistoryAction.java
index b0c74a2dfac8..e477e2746d58 100644
--- 
a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/action/CamelHistoryAction.java
+++ 
b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/action/CamelHistoryAction.java
@@ -60,9 +60,12 @@ public class CamelHistoryAction extends ActionWatchCommand {
                         description = "Whether to mask endpoint URIs to avoid 
printing sensitive information such as password or access keys")
     boolean mask;
 
+    @CommandLine.Option(names = { "--depth" }, defaultValue = "9",
+                        description = "Depth of tracing. 0=Created+Completed. 
1=All events on 1st route, 2=All events on 1st+2nd depth, and so on. 9 = all 
events on every depth.")
+    int depth;
+
     private final CamelCatalog camelCatalog = new DefaultCamelCatalog(true);
 
-    // TODO: option to max deep level (like trace)
     // TODO: option to collapse split (to cut very large split)
 
     public CamelHistoryAction(CamelJBangMain main) {
@@ -132,6 +135,17 @@ public class CamelHistoryAction extends ActionWatchCommand 
{
         return 0;
     }
 
+    private boolean filterDepth(Row row) {
+        if (depth >= 9) {
+            return true;
+        }
+        if (depth == 0) {
+            // special with only created/completed
+            return row.nodeLevel == 1 && (row.first || row.last);
+        }
+        return row.nodeLevel <= depth;
+    }
+
     private String getId(Row r) {
         String answer;
         if (source && r.location != null) {
@@ -282,10 +296,18 @@ public class CamelHistoryAction extends 
ActionWatchCommand {
                     row.message.remove("exchangePattern");
                     rows.add(row);
                 }
+
                 // enhance rows by analysis the history to enrich endpoints 
and EIPs with summary
                 analyseRows(rows);
             }
-            return rows;
+
+            List<Row> answer = new ArrayList<>();
+            for (Row r : rows) {
+                if (filterDepth(r)) {
+                    answer.add(r);
+                }
+            }
+            return answer;
         }
         return null;
     }

Reply via email to