You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@storm.apache.org by ag...@apache.org on 2021/10/25 15:13:47 UTC

[storm] branch master updated: STORM-3802 allow adding system metrics reporters to all topologies (#3419)

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

agresch pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/storm.git


The following commit(s) were added to refs/heads/master by this push:
     new 30857b7  STORM-3802 allow adding system metrics reporters to all topologies (#3419)
30857b7 is described below

commit 30857b7d54ac7a91c42e0816cb0fbcdcd111e89f
Author: agresch <ag...@gmail.com>
AuthorDate: Mon Oct 25 10:12:36 2021 -0500

    STORM-3802 allow adding system metrics reporters to all topologies (#3419)
---
 storm-client/src/jvm/org/apache/storm/Config.java                | 6 ++++++
 .../src/main/java/org/apache/storm/daemon/nimbus/Nimbus.java     | 9 +++++++++
 2 files changed, 15 insertions(+)

diff --git a/storm-client/src/jvm/org/apache/storm/Config.java b/storm-client/src/jvm/org/apache/storm/Config.java
index 27f637a..8deba5e 100644
--- a/storm-client/src/jvm/org/apache/storm/Config.java
+++ b/storm-client/src/jvm/org/apache/storm/Config.java
@@ -1216,6 +1216,12 @@ public class Config extends HashMap<String, Object> {
     public static final String TOPOLOGY_METRICS_REPORTERS = "topology.metrics.reporters";
 
     /**
+     * A list of system metrics reporters that will get added to each topology.
+     */
+    @IsListEntryCustom(entryValidatorClasses = { MetricReportersValidator.class })
+    public static final String STORM_TOPOLOGY_METRICS_SYSTEM_REPORTERS = "storm.topology.metrics.system.reporters";
+
+    /**
      * Configure the topology metrics reporters to be used on workers.
      * @deprecated Use {@link Config#TOPOLOGY_METRICS_REPORTERS} instead.
      */
diff --git a/storm-server/src/main/java/org/apache/storm/daemon/nimbus/Nimbus.java b/storm-server/src/main/java/org/apache/storm/daemon/nimbus/Nimbus.java
index e1741ab..ce55a85 100644
--- a/storm-server/src/main/java/org/apache/storm/daemon/nimbus/Nimbus.java
+++ b/storm-server/src/main/java/org/apache/storm/daemon/nimbus/Nimbus.java
@@ -1152,6 +1152,15 @@ public class Nimbus implements Iface, Shutdownable, DaemonCommon {
             ret.put(Config.TOPOLOGY_METRICS_REPORTERS, mergedConf.get(Config.STORM_METRICS_REPORTERS));
         }
 
+        // add any system metrics reporters to the topology metrics reporters
+        if (conf.containsKey(Config.STORM_TOPOLOGY_METRICS_SYSTEM_REPORTERS)) {
+            List<Map<String, Object>> reporters = (List<Map<String, Object>>)
+                    ret.computeIfAbsent(Config.TOPOLOGY_METRICS_REPORTERS, (key) -> new ArrayList<>());
+            List<Map<String, Object>> systemReporters = (List<Map<String, Object>>)
+                    conf.get(Config.STORM_TOPOLOGY_METRICS_SYSTEM_REPORTERS);
+            reporters.addAll(systemReporters);
+        }
+
         // Don't allow topoConf to override various cluster-specific properties.
         // Specifically adding the cluster settings to the topoConf here will make sure these settings
         // also override the subsequently generated conf picked up locally on the classpath.