You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: instrumentation/jmx-metrics/javaagent/README.md
+26Lines changed: 26 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -282,6 +282,31 @@ In the particular case where only two values are defined, we can simplify furthe
282
282
off: '*'
283
283
```
284
284
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
+
285
310
### General Syntax
286
311
287
312
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
293
318
metricAttribute: # optional metric attributes, they apply to all metrics below
294
319
<ATTRIBUTE1>: param(<PARAM>) # <PARAM> is used as the key to extract value from actual ObjectName
295
320
<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
0 commit comments