Skip to content

Commit af4f7e1

Browse files
committed
update readme to fit semconv naming
1 parent 0d24efe commit af4f7e1

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

instrumentation/jmx-metrics/README.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -245,53 +245,53 @@ rules:
245245
metric: tomcat.connector.status
246246
metricAttribute:
247247
port: param(port)
248-
connector_state:
248+
tomcat.connector.state:
249249
ok: STARTED
250250
failed: [STOPPED,FAILED]
251251
degraded: '*'
252252
```
253253

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`:
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 `tomcat.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 `tomcat.connector.state` depending on the value of `stateName`:
256256

257257
When `stateName` = `STARTED`, we have:
258258

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`
259+
- `tomcat.connector.status` value = `1`, attributes `port` = `8080` and `tomcat.connector.state` = `ok`
260+
- `tomcat.connector.status` value = `0`, attributes `port` = `8080` and `tomcat.connector.state` = `failed`
261+
- `tomcat.connector.status` value = `0`, attributes `port` = `8080` and `tomcat.connector.state` = `degraded`
262262

263263
When `stateName` = `STOPPED` or `FAILED`, we have:
264264

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`
265+
- `tomcat.connector.status` value = `0`, attributes `port` = `8080` and `tomcat.connector.state` = `ok`
266+
- `tomcat.connector.status` value = `1`, attributes `port` = `8080` and `tomcat.connector.state` = `failed`
267+
- `tomcat.connector.status` value = `0`, attributes `port` = `8080` and `tomcat.connector.state` = `degraded`
268268

269269
For other values of `stateName`, we have:
270270

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`
271+
- `tomcat.connector.status` value = `0`, attributes `port` = `8080` and `tomcat.connector.state` = `ok`
272+
- `tomcat.connector.status` value = `0`, attributes `port` = `8080` and `tomcat.connector.state` = `failed`
273+
- `tomcat.connector.status` value = `1`, attributes `port` = `8080` and `tomcat.connector.state` = `degraded`
274274

275275
Each state key can be mapped to one or more values of the MBean attribute using:
276276
- a string literal or a string array
277277
- a `*` character to provide default option and avoid enumerating all values, this value must be quoted in YAML
278278

279279
Exactly one `*` value must be present in the mapping to ensure all possible values of the MBean attribute can be mapped to a state key.
280280

281-
The default value indicated by `*` does not require a dedicated state key. For example, if we want to have `connector_state` metric attribute with values `on` or `off`, we can use:
281+
The default value indicated by `*` does not require a dedicated state key. For example, if we want to have `tomcat.connector.state` metric attribute with values `on` or `off`, we can use:
282282
```yaml
283-
connector_state:
283+
tomcat.connector.state:
284284
on: STARTED
285285
off: [STOPPED,FAILED,'*']
286286
```
287287
In the particular case where only two values are defined, we can simplify further by explicitly defining one state and rely on default for the other.
288288
```yaml
289-
connector_state:
289+
tomcat.connector.state:
290290
on: STARTED
291291
off: '*'
292292
```
293293

294-
State metrics do not have a unit (nor source unit) and use an empty string `""` as unit.
294+
State metrics do not need to define `unit` nor `sourceUnit` attributes, the unit of the metric will always be `1`.
295295

296296
### Metric attributes modifiers
297297

0 commit comments

Comments
 (0)