@@ -52,6 +52,10 @@ public String getMonitoringService() {
52
52
return _monitoringService ;
53
53
}
54
54
55
+ public Optional <String > getMonitoringHost () {
56
+ return _monitoringHost ;
57
+ }
58
+
55
59
public ImmutableList <JsonNode > getMonitoringSinks () {
56
60
return _monitoringSinks ;
57
61
}
@@ -132,6 +136,7 @@ public String toString() {
132
136
.add ("id" , Integer .toHexString (System .identityHashCode (this )))
133
137
.add ("MonitoringCluster" , _monitoringCluster )
134
138
.add ("MonitoringService" , _monitoringService )
139
+ .add ("MonitoringHost" , _monitoringHost )
135
140
.add ("MonitoringSinks" , _monitoringSinks )
136
141
.add ("MetricsClientHost" , _metricsClientHost )
137
142
.add ("MetricsClientPort" , _metricsClientPort )
@@ -172,6 +177,7 @@ private AggregatorConfiguration(final Builder builder) {
172
177
_supplementalHttpRoutesClass = Optional .ofNullable (builder ._supplementalHttpRoutesClass );
173
178
_logDeadLetters = builder ._logDeadLetters ;
174
179
_akkaConfiguration = builder ._akkaConfiguration ;
180
+ _monitoringHost = Optional .ofNullable (builder ._monitoringHost );
175
181
176
182
// Deprecated legacy settings
177
183
_metricsClientHost = Optional .ofNullable (builder ._metricsClientHost );
@@ -180,6 +186,7 @@ private AggregatorConfiguration(final Builder builder) {
180
186
181
187
private final String _monitoringCluster ;
182
188
private final String _monitoringService ;
189
+ private final Optional <String > _monitoringHost ;
183
190
private final ImmutableList <JsonNode > _monitoringSinks ;
184
191
private final Optional <String > _metricsClientHost ;
185
192
private final Optional <Integer > _metricsClientPort ;
@@ -428,6 +435,17 @@ public Builder setSupplementalHttpRoutesClass(final Class<? extends Supplemental
428
435
return this ;
429
436
}
430
437
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
+
431
449
/**
432
450
* Whether to install the {@link com.arpnetworking.metrics.mad.actors.DeadLetterLogger}
433
451
* to log all dead letter senders, recipients and messages. It differs
@@ -465,6 +483,9 @@ public Builder setAkkaConfiguration(final Map<String, ?> value) {
465
483
@ NotNull
466
484
@ NotEmpty
467
485
private String _monitoringService = "mad" ;
486
+ @ Nullable
487
+ @ NotEmpty
488
+ private String _monitoringHost ;
468
489
// TODO(ville): Apply the default here once we migrate off JsonNode.
469
490
@ NotNull
470
491
private ImmutableList <JsonNode > _monitoringSinks ;
0 commit comments