diff options
author | gjoranv <gv@verizonmedia.com> | 2020-02-20 17:11:16 +0100 |
---|---|---|
committer | gjoranv <gv@verizonmedia.com> | 2020-02-20 17:11:16 +0100 |
commit | 23c1869c5c2038cfa282db3f5e93fdfedbb7f9a3 (patch) | |
tree | d2db033069bd4f3c177a43be7d37ff9492528d50 /config-model | |
parent | 18d50dcbb243b3e021631ef19b7f9e879ba4a00b (diff) |
Revert "Add Telegraf components to metrics-proxy clusters."
This reverts commit 5de8c5e24ca3cecb2603496e7969afdb1934a4e9.
Diffstat (limited to 'config-model')
2 files changed, 10 insertions, 37 deletions
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/admin/metricsproxy/MetricsProxyContainerCluster.java b/config-model/src/main/java/com/yahoo/vespa/model/admin/metricsproxy/MetricsProxyContainerCluster.java index 91a5cffbe6b..f81757ac568 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/admin/metricsproxy/MetricsProxyContainerCluster.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/admin/metricsproxy/MetricsProxyContainerCluster.java @@ -20,9 +20,7 @@ import ai.vespa.metricsproxy.metric.dimensions.PublicDimensions; import ai.vespa.metricsproxy.rpc.RpcServer; import ai.vespa.metricsproxy.service.ConfigSentinelClient; import ai.vespa.metricsproxy.service.SystemPollerProvider; -import ai.vespa.metricsproxy.telegraf.Telegraf; import ai.vespa.metricsproxy.telegraf.TelegrafConfig; -import ai.vespa.metricsproxy.telegraf.TelegrafRegistry; import com.yahoo.config.model.deploy.DeployState; import com.yahoo.config.model.producer.AbstractConfigProducer; import com.yahoo.config.model.producer.AbstractConfigProducerRoot; @@ -112,8 +110,6 @@ public class MetricsProxyContainerCluster extends ContainerCluster<MetricsProxyC addMetricsProxyComponent(MetricsManager.class); addMetricsProxyComponent(RpcServer.class); addMetricsProxyComponent(SystemPollerProvider.class); - addMetricsProxyComponent(Telegraf.class); - addMetricsProxyComponent(TelegrafRegistry.class); addMetricsProxyComponent(VespaMetrics.class); addHttpHandler(MetricsV1Handler.class, MetricsV1Handler.V1_PATH); diff --git a/config-model/src/test/java/com/yahoo/vespa/model/admin/metricsproxy/TelegrafTest.java b/config-model/src/test/java/com/yahoo/vespa/model/admin/metricsproxy/TelegrafTest.java index e1897397bae..144c45a7dd2 100644 --- a/config-model/src/test/java/com/yahoo/vespa/model/admin/metricsproxy/TelegrafTest.java +++ b/config-model/src/test/java/com/yahoo/vespa/model/admin/metricsproxy/TelegrafTest.java @@ -1,20 +1,13 @@ package com.yahoo.vespa.model.admin.metricsproxy; -import ai.vespa.metricsproxy.telegraf.Telegraf; import ai.vespa.metricsproxy.telegraf.TelegrafConfig; -import ai.vespa.metricsproxy.telegraf.TelegrafRegistry; -import com.yahoo.component.ComponentId; import com.yahoo.vespa.model.VespaModel; -import org.jetbrains.annotations.NotNull; import org.junit.Test; import static com.yahoo.vespa.model.admin.metricsproxy.MetricsProxyModelTester.CLUSTER_CONFIG_ID; import static com.yahoo.vespa.model.admin.metricsproxy.MetricsProxyModelTester.TestMode.hosted; import static com.yahoo.vespa.model.admin.metricsproxy.MetricsProxyModelTester.getModel; -import static org.hamcrest.CoreMatchers.hasItem; import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertThat; -import static org.junit.Assert.assertTrue; /** * @author gjoranv @@ -22,33 +15,8 @@ import static org.junit.Assert.assertTrue; public class TelegrafTest { @Test - public void telegraf_components_are_set_up() { - String services = servicesWithCloudwatch(); - VespaModel hostedModel = getModel(services, hosted); - - var clusterComponents = hostedModel.getAdmin().getMetricsProxyCluster().getComponentsMap(); - assertThat(clusterComponents.keySet(), hasItem(ComponentId.fromString(Telegraf.class.getName()))); - assertThat(clusterComponents.keySet(), hasItem(ComponentId.fromString(TelegrafRegistry.class.getName()))); - } - - @Test public void telegraf_config_is_generated_for_cloudwatch_in_services() { - String services = servicesWithCloudwatch(); - VespaModel hostedModel = getModel(services, hosted); - TelegrafConfig config = hostedModel.getConfig(TelegrafConfig.class, CLUSTER_CONFIG_ID); - - var cloudWatch0 = config.cloudWatch(0); - assertEquals("cloudwatch-consumer", cloudWatch0.consumer()); - assertEquals("us-east-1", cloudWatch0.region()); - assertEquals("my-namespace", cloudWatch0.namespace()); - assertEquals("my-access-key", cloudWatch0.accessKeyName()); - assertEquals("my-secret-key", cloudWatch0.secretKeyName()); - assertEquals("", cloudWatch0.profile()); - } - - @NotNull - private String servicesWithCloudwatch() { - return String.join("\n", + String services = String.join("\n", "<services>", " <admin version='2.0'>", " <adminserver hostalias='node1'/>", @@ -64,6 +32,15 @@ public class TelegrafTest { " </admin>", "</services>" ); + VespaModel hostedModel = getModel(services, hosted); + TelegrafConfig config = hostedModel.getConfig(TelegrafConfig.class, CLUSTER_CONFIG_ID); + var cloudWatch0 = config.cloudWatch(0); + assertEquals("cloudwatch-consumer", cloudWatch0.consumer()); + assertEquals("us-east-1", cloudWatch0.region()); + assertEquals("my-namespace", cloudWatch0.namespace()); + assertEquals("my-access-key", cloudWatch0.accessKeyName()); + assertEquals("my-secret-key", cloudWatch0.secretKeyName()); + assertEquals("", cloudWatch0.profile()); } @Test |