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 2024/03/06 13:32:50 UTC

(camel) 05/07: CAMEL-20461: camel-jbang - get metrics should filter by tags also.

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

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

commit dab7ece9741fafcbfa2708e66c250b3ebb5ffac9
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Wed Mar 6 14:26:02 2024 +0100

    CAMEL-20461: camel-jbang - get metrics should filter by tags also.
---
 .../org/apache/camel/dsl/jbang/core/commands/process/ListMetric.java  | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/process/ListMetric.java b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/process/ListMetric.java
index 289c93a2dcb..8b4284b7bd4 100644
--- a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/process/ListMetric.java
+++ b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/process/ListMetric.java
@@ -46,7 +46,7 @@ public class ListMetric extends ProcessWatchCommand {
     String sort;
 
     @CommandLine.Option(names = { "--filter" },
-                        description = "Filter metric by type or name")
+                        description = "Filter metric by type, name or tags")
     String filter;
 
     @CommandLine.Option(names = { "--tags" },
@@ -136,7 +136,7 @@ public class ListMetric extends ProcessWatchCommand {
                                     if (!all && getNumber(row.count).isEmpty()) {
                                         continue;
                                     }
-                                    if (filter == null || row.type.equals(filter) || row.metricName.contains(filter)) {
+                                    if (filter == null || row.type.equals(filter) || row.metricName.contains(filter) || row.tags.contains(filter)) {
                                         rows.add(row);
                                     }
                                 }