Skip to content

Commit

Permalink
Making sure there's a distinction between metrics publisher and metri…
Browse files Browse the repository at this point in the history
…cs publisher's publish frequency (#199)

Co-authored-by: Sundaram Ananthanarayanan <[email protected]>
  • Loading branch information
sundargates and sundargates authored Apr 23, 2022
1 parent 256d3cd commit 066d211
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,11 @@ public interface CoreConfiguration {
@Default("true")
boolean isLocalMode();

@Config("mantis.metricsPublisher")
@Config("mantis.metricsPublisher.class")
@Default("io.mantisrx.common.metrics.MetricsPublisherNoOp")
MetricsPublisher getMetricsPublisher();

@Config("mantis.metricsPublisher.publishFrequencyInSeconds")
@Default("15")
int getMetricsPublisherFrequencyInSeconds();

@Config("mantis.metricsPublisher.config.prefix")
@Default("")
String getMetricsPublisherConfigPrefix();
}
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,9 @@ public MasterMain(ConfigurationFactory configFactory, AuditEventSubscriber audit
ConfigurationProvider.getConfig().getActiveSlaveAttributeName());

// start serving metrics
if (config.getMasterMetricsPort() > 0)
if (config.getMasterMetricsPort() > 0) {
new MetricsServerService(config.getMasterMetricsPort(), 1, Collections.emptyMap()).start();
}
new MetricsPublisherService(config.getMetricsPublisher(), config.getMetricsPublisherFrequencyInSeconds(),
new HashMap<>()).start();

Expand Down

0 comments on commit 066d211

Please sign in to comment.