Search in sources :

Example 1 with MetricsRestPublisher

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);
}
Also used : MetricsRestPublisher(org.apache.servicecomb.metrics.core.publish.MetricsRestPublisher)

Aggregations

MetricsRestPublisher (org.apache.servicecomb.metrics.core.publish.MetricsRestPublisher)1