Skip to content

Commit

Permalink
AMLII-1173 - Modify JMXFetch to pass back a tag with the jmx_check_na…
Browse files Browse the repository at this point in the history
…me to the Agent (#492)
  • Loading branch information
rayz authored Nov 6, 2023
1 parent 7c2921b commit 1f40ce0
Show file tree
Hide file tree
Showing 6 changed files with 174 additions and 155 deletions.
1 change: 1 addition & 0 deletions src/main/java/org/datadog/jmxfetch/JmxAttribute.java
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ private List<String> getBeanParametersList(
List<String> beanTags = new ArrayList<String>();
beanTags.add("instance:" + instanceName);
beanTags.add("jmx_domain:" + domain);
beanTags.add("jmx_check_name:" + checkName);

if (renameCassandraMetrics()) {
beanTags.addAll(getCassandraBeanTags(beanParameters));
Expand Down
324 changes: 170 additions & 154 deletions src/test/java/org/datadog/jmxfetch/TestApp.java

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion src/test/java/org/datadog/jmxfetch/TestCommon.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.datadog.jmxfetch;

import static org.hamcrest.CoreMatchers.hasItem;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
Expand Down Expand Up @@ -280,7 +282,7 @@ public void assertMetric(
assertEquals(countTags, mTags.size());
}
for (String t : tags) {
assertTrue(mTags.contains(t));
assertThat(mTags, hasItem(t));
}

if (metricType != null) {
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit 1f40ce0

Please sign in to comment.