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/README.md
+16-12Lines changed: 16 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -229,6 +229,10 @@ The metric descriptions will remain undefined, unless they are provided by the q
229
229
### State Metrics
230
230
231
231
Some JMX attributes expose current state as a non-numeric MBean attribute, in order to capture those as metrics it is recommended to use the special `state` metric type.
232
+
233
+
This type of metric fits the [semantic conventions recommendations for state metric](https://github.com/open-telemetry/semantic-conventions/blob/main/docs/how-to-write-conventions/status-metrics.md),
234
+
using the `.status` suffix is compliant with the [naming recommendations](https://github.com/open-telemetry/semantic-conventions/blob/main/docs/how-to-write-conventions/status-metrics.md#naming).
235
+
232
236
For example, with Tomcat connector, the `Catalina:type=Connector,port=*` MBean has `stateName` (of type `String`), we can define the following rule:
233
237
234
238
```yaml
@@ -238,7 +242,7 @@ rules:
238
242
mapping:
239
243
stateName:
240
244
type: state
241
-
metric: tomcat.connector
245
+
metric: tomcat.connector.status
242
246
metricAttribute:
243
247
port: param(port)
244
248
connector_state:
@@ -247,26 +251,26 @@ rules:
247
251
degraded: '*'
248
252
```
249
253
250
-
For a given value of `port`, let's say `8080` This will capture the `tomcat.connector.state` metric of type `updowncounter` with value `0` or `1` and the `state` metric attribute will have a value in [`ok`,`failed`,`degraded`].
251
-
For every sample, 3 metrics will be captured for each value of `state` depending on the value of `stateName`:
254
+
For a given value of `port`, let's say `8080` This will capture the `tomcat.connector.status` metric of type `updowncounter` with value `0` or `1` and the `connector_state` metric attribute will have a value in [`ok`,`failed`,`degraded`].
255
+
For every sample, 3 metrics will be captured for each value of `connector_state` depending on the value of `stateName`:
0 commit comments