MetricsProxyContainerCluster extends ContainerCluster<MetricsProxyContainer> implements
        ApplicationDimensionsConfig.Producer,
        ConsumersConfig.Producer,
        MonitoringConfig.Producer,
        TelegrafConfig.Producer,
        MetricsNodesConfig.Producer { private Optional<Admin> getAdmin() { if (parent != null) { AbstractConfigProducerRoot r = parent.getRoot(); if (r instanceof VespaModel) { VespaModel model = (VespaModel) r; return Optional.ofNullable(model.getAdmin()); } } return Optional.empty(); } MetricsProxyContainerCluster(AbstractConfigProducer<?> parent, String name, DeployState deployState); @Override void getConfig(MetricsNodesConfig.Builder builder); @Override void getConfig(MonitoringConfig.Builder builder); @Override void getConfig(ConsumersConfig.Builder builder); @Override void getConfig(ApplicationDimensionsConfig.Builder builder); @Override void getConfig(TelegrafConfig.Builder builder); @Override void getConfig(ThreadpoolConfig.Builder builder); static final Logger log; }
@Test public void http_handlers_are_set_up() { VespaModel model = getModel(servicesWithAdminOnly(), self_hosted); Collection<Handler<?>> handlers = model.getAdmin().getMetricsProxyCluster().getHandlers(); Collection<ComponentSpecification> handlerClasses = handlers.stream().map(Component::getClassId).collect(toList()); assertThat(handlerClasses, hasItem(ComponentSpecification.fromString(MetricsV1Handler.class.getName()))); assertThat(handlerClasses, hasItem(ComponentSpecification.fromString(PrometheusHandler.class.getName()))); assertThat(handlerClasses, hasItem(ComponentSpecification.fromString(YamasHandler.class.getName()))); assertThat(handlerClasses, hasItem(ComponentSpecification.fromString(ApplicationMetricsHandler.class.getName()))); }