Skip to content

Commit

Permalink
Fix empty include in configuration
Browse files Browse the repository at this point in the history
An empty 'include' configuration would produce a beanScrope of '*:*' and
would match every bean from the server without applying any of the
default configuration
  • Loading branch information
hush-hush committed Dec 15, 2020
1 parent 9cd2a64 commit 62b1bd1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/org/datadog/jmxfetch/Configuration.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public String toString() {
}

private Boolean hasInclude() {
return getInclude() != null;
return getInclude() != null && !getInclude().isEmptyFilter();
}

/**
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/org/datadog/jmxfetch/Filter.java
Original file line number Diff line number Diff line change
Expand Up @@ -188,4 +188,8 @@ public List<String> getParameterValues(String parameterName) {
public boolean isEmptyBeanName() {
return (filter.get("bean") == null && filter.get("bean_name") == null);
}

public boolean isEmptyFilter() {
return filter.isEmpty();
}
}

0 comments on commit 62b1bd1

Please sign in to comment.