Skip to content

Commit

Permalink
fixx doc and remove comment
Browse files Browse the repository at this point in the history
  • Loading branch information
jackshirazi committed Oct 20, 2023
1 parent 101f93d commit 900410b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -304,10 +304,6 @@ private static void addJmxMetricRegistration(final JmxMetric jmxMetric, List<Jmx
for (MBeanAttributeInfo attr : attrInfo) {
try {
final Object value = server.getAttribute(objectName, attr.getName());
String foundName;
// if (labels.("type") != null) {
// foundName
// }
addJmxMetricRegistration(jmxMetric, registrations, objectName, value, attribute, attr.getName(), metricPrepend);
} catch (AttributeNotFoundException e) {
logger.warn("Can't create metric '{}' because attribute '{}' could not be found", jmxMetric, attribute.getJmxAttributeName());
Expand Down
10 changes: 6 additions & 4 deletions docs/configuration.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -2003,8 +2003,9 @@ Note that all JMX metric names will be prefixed with `jvm.jmx.` by the agent.

The agent creates `labels` for each link:https://docs.oracle.com/javase/7/docs/api/javax/management/ObjectName.html#getKeyPropertyList()[JMX key property] such as `type` and `name`.

The link:https://docs.oracle.com/javase/7/docs/api/javax/management/ObjectName.html[JMX object name pattern] supports wildcards.
In this example, the agent will create a metricset for each memory pool `name` (such as `G1 Old Generation` and `G1 Young Generation`)
The link:https://docs.oracle.com/javase/7/docs/api/javax/management/ObjectName.html[JMX object name pattern] supports wildcards. The attribute definition does NOT support wildcards, but a special definition `attribute[*]` is accepted to mean match all possible (numeric) attributes for the associated object name pattern
The definition `object_name[*:type=*,name=*] attribute[*]` would match all possible JMX metrics
In the following example, the agent will create a metricset for each memory pool `name` (such as `G1 Old Generation` and `G1 Young Generation`)

----
object_name[java.lang:type=GarbageCollector,name=*] attribute[CollectionCount:metric_name=collection_count] attribute[CollectionTime]
Expand Down Expand Up @@ -4288,8 +4289,9 @@ Example: `5ms`.
#
# The agent creates `labels` for each link:https://docs.oracle.com/javase/7/docs/api/javax/management/ObjectName.html#getKeyPropertyList()[JMX key property] such as `type` and `name`.
#
# The link:https://docs.oracle.com/javase/7/docs/api/javax/management/ObjectName.html[JMX object name pattern] supports wildcards.
# In this example, the agent will create a metricset for each memory pool `name` (such as `G1 Old Generation` and `G1 Young Generation`)
# The link:https://docs.oracle.com/javase/7/docs/api/javax/management/ObjectName.html[JMX object name pattern] supports wildcards. The attribute definition does NOT support wildcards, but a special definition `attribute[*]` is accepted to mean match all possible (numeric) attributes for the associated object name pattern
# The definition `object_name[*:type=*,name=*] attribute[*]` would match all possible JMX metrics
# In the following example, the agent will create a metricset for each memory pool `name` (such as `G1 Old Generation` and `G1 Young Generation`)
#
# ----
# object_name[java.lang:type=GarbageCollector,name=*] attribute[CollectionCount:metric_name=collection_count] attribute[CollectionTime]
Expand Down

0 comments on commit 900410b

Please sign in to comment.