Skip to content

Commit

Permalink
Limit pattern by name for ObjectName in TomcatMetrics
Browse files Browse the repository at this point in the history
Closes gh-1145
  • Loading branch information
izeye authored and jkschneider committed Jan 10, 2019
1 parent ddd5cfc commit 680f810
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -214,7 +214,7 @@ private void registerGlobalRequestMetrics(MeterRegistry registry) {
private void registerMetricsEventually(String key, String value, BiConsumer<ObjectName, Iterable<Tag>> perObject) {
if (getJmxDomain() != null) {
try {
Set<ObjectName> objectNames = this.mBeanServer.queryNames(new ObjectName(getJmxDomain() + ":" + key + "=" + value + ",*"), null);
Set<ObjectName> objectNames = this.mBeanServer.queryNames(new ObjectName(getJmxDomain() + ":" + key + "=" + value + ",name=*"), null);
if (!objectNames.isEmpty()) {
// MBean is present, so we can register metrics now.
objectNames.forEach(objectName -> perObject.accept(objectName, Tags.concat(tags, nameTag(objectName))));
Expand Down

0 comments on commit 680f810

Please sign in to comment.