Skip to content

Commit

Permalink
remove pid anv jvmName tags as it bloats influx (they should really b…
Browse files Browse the repository at this point in the history
…e values, not tags)
  • Loading branch information
dorinp committed Nov 12, 2018
1 parent 15a14db commit 20f2f8a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>com.etsy</groupId>
<artifactId>statsd-jvm-profiler</artifactId>
<version>2.1.1-SNAPSHOT</version>
<version>2.1.2-SNAPSHOT</version>
<packaging>jar</packaging>

<name>statsd-jvm-profiler</name>
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/com/etsy/statsd/profiler/util/TagUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ private TagUtil() { }
public static Map<String, String> getGlobalTags(Map<String, String> 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);
}

Expand Down
4 changes: 2 additions & 2 deletions src/test/java/com/etsy/statsd/profiler/util/TagUtilTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ public void testGetGlobalTags() {
Map<String, String> globalTags = new HashMap<>();
TagUtil.getGlobalTags(globalTags);
Set<String> 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());
}
Expand Down

0 comments on commit 20f2f8a

Please sign in to comment.