Skip to content

Commit 66d676c

Browse files
committed
update documentation
1 parent ac96916 commit 66d676c

File tree

1 file changed

+26
-0
lines changed
  • instrumentation/jmx-metrics/javaagent

1 file changed

+26
-0
lines changed

instrumentation/jmx-metrics/javaagent/README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,31 @@ In the particular case where only two values are defined, we can simplify furthe
282282
off: '*'
283283
```
284284

285+
### Metric attributes modifiers
286+
287+
JMX attributes values may require modification or normalization in order to fit semantic conventions.
288+
289+
For example, with JVM memory, the `java.lang:name=*,type=MemoryPool` MBeans have `type` attribute with either `HEAP` or `NON_HEAP` value.
290+
However, in the semantic conventions the metric attribute `jvm.memory.type` should be lower-cased to fit the `jvm.memory.used` definition, in this case we can
291+
apply the `lowercase` metric attribute transformation as follows:
292+
293+
294+
```yaml
295+
---
296+
rules:
297+
- bean: java.lang:name=*,type=MemoryPool
298+
mapping:
299+
Usage.used:
300+
type: updowncounter
301+
metric: jvm.memory.used
302+
unit: By
303+
metricAttribute:
304+
jvm.memory.pool.name : param(name)
305+
jvm.memory.type: lowercase(beanattr(type))
306+
```
307+
308+
For now, only the `lowercase` transformation is supported, other additions might be added in the future if needed.
309+
285310
### General Syntax
286311

287312
Here is the general description of the accepted configuration file syntax. The whole contents of the file is case-sensitive, with exception for `type` as described in the table below.
@@ -293,6 +318,7 @@ rules: # start of list of configuration rules
293318
metricAttribute: # optional metric attributes, they apply to all metrics below
294319
<ATTRIBUTE1>: param(<PARAM>) # <PARAM> is used as the key to extract value from actual ObjectName
295320
<ATTRIBUTE2>: beanattr(<ATTR>) # <ATTR> is used as the MBean attribute name to extract the value
321+
<ATTRIBUTE3>: const(<CONST>) # <CONST> is used as a constant
296322
prefix: <METRIC_NAME_PREFIX> # optional, useful for avoiding specifying metric names below
297323
unit: <UNIT> # optional, redefines the default unit for the whole rule
298324
type: <TYPE> # optional, redefines the default type for the whole rule

0 commit comments

Comments
 (0)