From bbd8d1ecab4f0424ccd5ebaac86e1a36c133420a Mon Sep 17 00:00:00 2001 From: Justin Field Date: Wed, 13 Mar 2019 18:15:33 -1000 Subject: [PATCH] Add server group and region dimensions to enable canary analysis with signalfx (#192) --- gradle.properties | 2 +- .../com/nike/cerberus/config/MetricsConfigurationHelper.java | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index eadd9d681..2fa598cfe 100644 --- a/gradle.properties +++ b/gradle.properties @@ -14,6 +14,6 @@ # limitations under the License. # -version=3.25.8 +version=3.26.0 groupId=com.nike.cerberus artifactId=cms diff --git a/src/main/java/com/nike/cerberus/config/MetricsConfigurationHelper.java b/src/main/java/com/nike/cerberus/config/MetricsConfigurationHelper.java index 4e6aab8b9..d04c3ed5d 100644 --- a/src/main/java/com/nike/cerberus/config/MetricsConfigurationHelper.java +++ b/src/main/java/com/nike/cerberus/config/MetricsConfigurationHelper.java @@ -84,6 +84,9 @@ public SignalFxReporterFactory generateSignalFxReporterFactory( String host = EC2MetadataUtils.getLocalHostName(); String ec2Hostname = EC2_HOSTNAME_PREFIX + EC2MetadataUtils.getPrivateIpAddress(); + String serverGroup = System.getProperty("serverGroup", "unknown"); + String serverRegion = System.getProperty("serverRegion", "unknown"); + Function defaultReporterConfigurator = (builder) -> builder .addUniqueDimension("host", host) @@ -92,6 +95,8 @@ public SignalFxReporterFactory generateSignalFxReporterFactory( .addUniqueDimension("env", signalFxAppEnvDim) .addUniqueDimension("framework", "riposte") .addUniqueDimension("app_version", serviceVersionDim) + .addUniqueDimension("server_group", serverGroup) + .addUniqueDimension("server_region", serverRegion) .setDetailsToAdd(finalMetricDetailsToReport); if (customReporterConfigurator == null)