use of org.apache.servicecomb.metrics.core.publish.MetricsRestPublisher in project java-chassis by ServiceComb.
the class MetricsBootListener method onBeforeProducerProvider.
@Override
public void onBeforeProducerProvider(BootEvent event) {
if (!DynamicPropertyFactory.getInstance().getBooleanProperty("servicecomb.metrics.endpoint.enabled", true).get()) {
return;
}
MetricsRestPublisher metricsRestPublisher = SPIServiceUtils.getTargetService(MetricsInitializer.class, MetricsRestPublisher.class);
event.getScbEngine().getProducerProviderManager().addProducerMeta("metricsEndpoint", metricsRestPublisher);
}
Aggregations