Skip to content

Commit

Permalink
Describe how to add tags manually to JMX MBeans
Browse files Browse the repository at this point in the history
- the 'tags' entry was added to jmxfetch in release 0.14 (see this PR: DataDog/jmxfetch#117)
- this commit adds to the java integration how to use this new 'tags' option to append new tags manually to a metric
  • Loading branch information
sv3ndk committed Jul 21, 2017
1 parent 2a56aa9 commit c837772
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions content/integrations/java.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ Make sure you can open a [JMX remote connection](http://docs.oracle.com/javase/1
conf:
- include:
domain: my_domain
tags:
simple: $attr0
raw_value: my_chosen_value
multiple: $attr0-$attr1
bean:
- my_bean
- my_second_bean
Expand Down Expand Up @@ -94,11 +98,11 @@ The `conf` parameter is a list of dictionaries. Only 2 keys are allowed in this
* `include` (**mandatory**): Dictionary of filters, any attribute that matches these filters will be collected unless it also matches the "exclude" filters (see below)
* `exclude` (**optional**): Another dictionary of filters. Attributes that match these filters won't be collected

For a given bean, metrics get tagged in the following manner:
Tags are automatically added to the metrics based on the MBean actual name and you can also explicitly specify supplementary tags. For example, assuming the following MBean is exposed by the application you're monitoring:

mydomain:attr0=val0,attr1=val1

Your metric will be mydomain (or some variation depending on the attribute inside the bean) and have the tags `attr0:val0, attr1:val1, domain:mydomain`.
The example configuration above would create a metric called `mydomain` (or some variation depending on the attribute inside the bean) and have the tags `attr0:val0, attr1:val1, domain:mydomain, simple:val0, raw_value:my_chosen_value, multiple:val0-val1`.

If you specify an alias in an `include` key that is formatted as *camel case*, it will be converted to *snake case*. For example, `MyMetricName` will be shown in Datadog as `my_metric_name`.

Expand Down

0 comments on commit c837772

Please sign in to comment.