From 20f2f8aab0e5a7e0a845dc326eccfc3cad2ea939 Mon Sep 17 00:00:00 2001 From: Dorin Date: Mon, 12 Nov 2018 12:02:24 +0000 Subject: [PATCH] remove pid anv jvmName tags as it bloats influx (they should really be values, not tags) --- pom.xml | 2 +- src/main/java/com/etsy/statsd/profiler/util/TagUtil.java | 6 +++--- .../java/com/etsy/statsd/profiler/util/TagUtilTest.java | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pom.xml b/pom.xml index 2491fc2..942be18 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.etsy statsd-jvm-profiler - 2.1.1-SNAPSHOT + 2.1.2-SNAPSHOT jar statsd-jvm-profiler diff --git a/src/main/java/com/etsy/statsd/profiler/util/TagUtil.java b/src/main/java/com/etsy/statsd/profiler/util/TagUtil.java index 0119ec0..2c100a5 100644 --- a/src/main/java/com/etsy/statsd/profiler/util/TagUtil.java +++ b/src/main/java/com/etsy/statsd/profiler/util/TagUtil.java @@ -25,13 +25,13 @@ private TagUtil() { } public static Map getGlobalTags(Map tags) { // Add the jvm name, pid, hostname as tags to help identify different processes final String jvmName = ManagementFactory.getRuntimeMXBean().getName(); - tags.put(JVM_NAME_TAG, jvmName); +// tags.put(JVM_NAME_TAG, jvmName); int atIndex = jvmName.indexOf("@"); if (atIndex > 0) { - tags.put(PID_TAG, jvmName.substring(0, atIndex)); +// tags.put(PID_TAG, jvmName.substring(0, atIndex)); tags.put(HOSTNAME_TAG, jvmName.substring(atIndex + 1)); } else { - tags.put(PID_TAG, UNKNOWN); +// tags.put(PID_TAG, UNKNOWN); tags.put(HOSTNAME_TAG, UNKNOWN); } diff --git a/src/test/java/com/etsy/statsd/profiler/util/TagUtilTest.java b/src/test/java/com/etsy/statsd/profiler/util/TagUtilTest.java index 66a0fcb..0e8ce7f 100644 --- a/src/test/java/com/etsy/statsd/profiler/util/TagUtilTest.java +++ b/src/test/java/com/etsy/statsd/profiler/util/TagUtilTest.java @@ -53,9 +53,9 @@ public void testGetGlobalTags() { Map globalTags = new HashMap<>(); TagUtil.getGlobalTags(globalTags); Set expectedKeys = new HashSet<>(); - expectedKeys.add(TagUtil.PID_TAG); +// expectedKeys.add(TagUtil.PID_TAG); expectedKeys.add(TagUtil.HOSTNAME_TAG); - expectedKeys.add(TagUtil.JVM_NAME_TAG); +// expectedKeys.add(TagUtil.JVM_NAME_TAG); assertEquals(expectedKeys, globalTags.keySet()); }