@@ -52,6 +52,10 @@ public String getMonitoringService() {
5252 return _monitoringService ;
5353 }
5454
55+ public Optional <String > getMonitoringHost () {
56+ return _monitoringHost ;
57+ }
58+
5559 public ImmutableList <JsonNode > getMonitoringSinks () {
5660 return _monitoringSinks ;
5761 }
@@ -132,6 +136,7 @@ public String toString() {
132136 .add ("id" , Integer .toHexString (System .identityHashCode (this )))
133137 .add ("MonitoringCluster" , _monitoringCluster )
134138 .add ("MonitoringService" , _monitoringService )
139+ .add ("MonitoringHost" , _monitoringHost )
135140 .add ("MonitoringSinks" , _monitoringSinks )
136141 .add ("MetricsClientHost" , _metricsClientHost )
137142 .add ("MetricsClientPort" , _metricsClientPort )
@@ -172,6 +177,7 @@ private AggregatorConfiguration(final Builder builder) {
172177 _supplementalHttpRoutesClass = Optional .ofNullable (builder ._supplementalHttpRoutesClass );
173178 _logDeadLetters = builder ._logDeadLetters ;
174179 _akkaConfiguration = builder ._akkaConfiguration ;
180+ _monitoringHost = Optional .ofNullable (builder ._monitoringHost );
175181
176182 // Deprecated legacy settings
177183 _metricsClientHost = Optional .ofNullable (builder ._metricsClientHost );
@@ -180,6 +186,7 @@ private AggregatorConfiguration(final Builder builder) {
180186
181187 private final String _monitoringCluster ;
182188 private final String _monitoringService ;
189+ private final Optional <String > _monitoringHost ;
183190 private final ImmutableList <JsonNode > _monitoringSinks ;
184191 private final Optional <String > _metricsClientHost ;
185192 private final Optional <Integer > _metricsClientPort ;
@@ -428,6 +435,17 @@ public Builder setSupplementalHttpRoutesClass(final Class<? extends Supplemental
428435 return this ;
429436 }
430437
438+ /**
439+ * The host to use as value for the host tag. Optional. Defaults to looking up the hostname.
440+ *
441+ * @param value The host to use as value for the host tag.
442+ * @return This instance of {@link Builder}.
443+ */
444+ public Builder setMonitoringHost (final String value ) {
445+ _monitoringHost = value ;
446+ return this ;
447+ }
448+
431449 /**
432450 * Whether to install the {@link com.arpnetworking.metrics.mad.actors.DeadLetterLogger}
433451 * to log all dead letter senders, recipients and messages. It differs
@@ -465,6 +483,9 @@ public Builder setAkkaConfiguration(final Map<String, ?> value) {
465483 @ NotNull
466484 @ NotEmpty
467485 private String _monitoringService = "mad" ;
486+ @ Nullable
487+ @ NotEmpty
488+ private String _monitoringHost ;
468489 // TODO(ville): Apply the default here once we migrate off JsonNode.
469490 @ NotNull
470491 private ImmutableList <JsonNode > _monitoringSinks ;
0 commit comments