Skip to content

Commit 31a890d

Browse files
committed
update feature description and link to semconv
1 parent a4ebb07 commit 31a890d

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

instrumentation/jmx-metrics/README.md

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,10 @@ The metric descriptions will remain undefined, unless they are provided by the q
229229
### State Metrics
230230

231231
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+
232236
For example, with Tomcat connector, the `Catalina:type=Connector,port=*` MBean has `stateName` (of type `String`), we can define the following rule:
233237

234238
```yaml
@@ -238,7 +242,7 @@ rules:
238242
mapping:
239243
stateName:
240244
type: state
241-
metric: tomcat.connector
245+
metric: tomcat.connector.status
242246
metricAttribute:
243247
port: param(port)
244248
connector_state:
@@ -247,26 +251,26 @@ rules:
247251
degraded: '*'
248252
```
249253

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`:
252256

253257
When `stateName` = `STARTED`, we have:
254258

255-
- `tomcat.connector` value = `1`, attributes `port` = `8080` and `connector_state` = `ok`
256-
- `tomcat.connector` value = `0`, attributes `port` = `8080` and `connector_state` = `failed`
257-
- `tomcat.connector` value = `0`, attributes `port` = `8080` and `connector_state` = `degraded`
259+
- `tomcat.connector.status` value = `1`, attributes `port` = `8080` and `connector_state` = `ok`
260+
- `tomcat.connector.status` value = `0`, attributes `port` = `8080` and `connector_state` = `failed`
261+
- `tomcat.connector.status` value = `0`, attributes `port` = `8080` and `connector_state` = `degraded`
258262

259263
When `stateName` = `STOPPED` or `FAILED`, we have:
260264

261-
- `tomcat.connector` value = `0`, attributes `port` = `8080` and `connector_state` = `ok`
262-
- `tomcat.connector` value = `1`, attributes `port` = `8080` and `connector_state` = `failed`
263-
- `tomcat.connector` value = `0`, attributes `port` = `8080` and `connector_state` = `degraded`
265+
- `tomcat.connector.status` value = `0`, attributes `port` = `8080` and `connector_state` = `ok`
266+
- `tomcat.connector.status` value = `1`, attributes `port` = `8080` and `connector_state` = `failed`
267+
- `tomcat.connector.status` value = `0`, attributes `port` = `8080` and `connector_state` = `degraded`
264268

265269
For other values of `stateName`, we have:
266270

267-
- `tomcat.connector` value = `0`, attributes `port` = `8080` and `connector_state` = `ok`
268-
- `tomcat.connector` value = `0`, attributes `port` = `8080` and `connector_state` = `failed`
269-
- `tomcat.connector` value = `1`, attributes `port` = `8080` and `connector_state` = `degraded`
271+
- `tomcat.connector.status` value = `0`, attributes `port` = `8080` and `connector_state` = `ok`
272+
- `tomcat.connector.status` value = `0`, attributes `port` = `8080` and `connector_state` = `failed`
273+
- `tomcat.connector.status` value = `1`, attributes `port` = `8080` and `connector_state` = `degraded`
270274

271275
Each state key can be mapped to one or more values of the MBean attribute using:
272276
- a string literal or a string array

0 commit comments

Comments
 (0)