diff options
author | Ola Aunrønning <olaa@verizonmedia.com> | 2020-02-14 18:21:16 +0100 |
---|---|---|
committer | Ola Aunrønning <olaa@verizonmedia.com> | 2020-02-20 11:09:59 +0100 |
commit | ee4be19769784b0e27efb77012f14e38a8ca986b (patch) | |
tree | d0e14d08942de3e8e449d9de4882ba287423168a /metrics-proxy | |
parent | 6f119796b599173a8c92930575c87924d81f05e2 (diff) |
Consider if cloudwatch profile is set. Removed compile specification in pom.
Diffstat (limited to 'metrics-proxy')
-rw-r--r-- | metrics-proxy/pom.xml | 1 | ||||
-rw-r--r-- | metrics-proxy/src/main/java/ai/vespa/metricsproxy/telegraf/Telegraf.java | 3 | ||||
-rw-r--r-- | metrics-proxy/src/main/resources/templates/cloudwatch_plugin.vm | 4 |
3 files changed, 4 insertions, 4 deletions
diff --git a/metrics-proxy/pom.xml b/metrics-proxy/pom.xml index 2b18b93055a..355f420c2a4 100644 --- a/metrics-proxy/pom.xml +++ b/metrics-proxy/pom.xml @@ -135,7 +135,6 @@ <dependency> <groupId>org.apache.velocity</groupId> <artifactId>velocity</artifactId> - <scope>compile</scope> </dependency> <!-- test scope --> diff --git a/metrics-proxy/src/main/java/ai/vespa/metricsproxy/telegraf/Telegraf.java b/metrics-proxy/src/main/java/ai/vespa/metricsproxy/telegraf/Telegraf.java index 09b888650e5..838d94d3593 100644 --- a/metrics-proxy/src/main/java/ai/vespa/metricsproxy/telegraf/Telegraf.java +++ b/metrics-proxy/src/main/java/ai/vespa/metricsproxy/telegraf/Telegraf.java @@ -40,6 +40,7 @@ public class Telegraf extends AbstractComponent { context.put("cloudwatchNamespace", telegrafConfig.cloudWatch().namespace()); context.put("cloudwatchSecretKey", telegrafConfig.cloudWatch().secretKeyName()); context.put("cloudwatchAccessKey", telegrafConfig.cloudWatch().accessKeyName()); + context.put("hasCloudwatchProfile", !telegrafConfig.cloudWatch().profile().isBlank()); context.put("cloudwatchProfile", telegrafConfig.cloudWatch().profile()); context.put("isHosted", !telegrafConfig.cloudWatch().secretKeyName().isBlank()); context.put("vespaConsumer", telegrafConfig.vespa().consumer()); @@ -64,7 +65,7 @@ public class Telegraf extends AbstractComponent { .successExitCodes(0) .build(); uncheck(() -> processExecutor.execute(command)) - .orElseThrow(() -> new RuntimeException("Running " + command + " timed out")); + .orElseThrow(() -> new RuntimeException("Timed out running command: " + command)); } @Override diff --git a/metrics-proxy/src/main/resources/templates/cloudwatch_plugin.vm b/metrics-proxy/src/main/resources/templates/cloudwatch_plugin.vm index 22349e34d67..fd1943fc50e 100644 --- a/metrics-proxy/src/main/resources/templates/cloudwatch_plugin.vm +++ b/metrics-proxy/src/main/resources/templates/cloudwatch_plugin.vm @@ -16,7 +16,7 @@ #if( $isHosted ) access_key = "$cloudwatchSecretKey" secret_key = "$cloudwatchAccessKey" -#else +#elseif( $hasCloudwatchProfile ) profile = "$cloudwatchProfile" #end @@ -27,4 +27,4 @@ tls_cert = "${VESPA_CERTIFICATE_PATH}" tls_key = "${VESPA_KEY_PATH}" insecure_skip_verify = true -#end
\ No newline at end of file +#end |