Skip to content

Commit

Permalink
Use global refs to io direction attributes
Browse files Browse the repository at this point in the history
disk.io.direction and network.io.direction were added to the global
registry, so this commit uses references to those attributes.
  • Loading branch information
braydonk committed Jan 10, 2024
1 parent 7333624 commit d971697
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 31 deletions.
36 changes: 18 additions & 18 deletions docs/system/process-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@ metrics](/docs/runtime/README.md#metrics).

<!-- toc -->

- [Metric Instruments](#metric-instruments)
* [Metric: `process.cpu.time`](#metric-processcputime)
* [Metric: `process.cpu.utilization`](#metric-processcpuutilization)
* [Metric: `process.memory.usage`](#metric-processmemoryusage)
* [Metric: `process.memory.virtual`](#metric-processmemoryvirtual)
* [Metric: `process.disk.io`](#metric-processdiskio)
* [Metric: `process.network.io`](#metric-processnetworkio)
* [Metric: `process.thread.count`](#metric-processthreadcount)
* [Metric: `process.open_file_descriptor.count`](#metric-processopen_file_descriptorcount)
* [Metric: `process.context_switches`](#metric-processcontext_switches)
* [Metric: `process.paging.faults`](#metric-processpagingfaults)
- [Process Metrics](#process-metrics)
- [Metric: `process.cpu.time`](#metric-processcputime)
- [Metric: `process.cpu.utilization`](#metric-processcpuutilization)
- [Metric: `process.memory.usage`](#metric-processmemoryusage)
- [Metric: `process.memory.virtual`](#metric-processmemoryvirtual)
- [Metric: `process.disk.io`](#metric-processdiskio)
- [Metric: `process.network.io`](#metric-processnetworkio)
- [Metric: `process.thread.count`](#metric-processthreadcount)
- [Metric: `process.open_file_descriptor.count`](#metric-processopen_file_descriptorcount)
- [Metric: `process.context_switches`](#metric-processcontext_switches)
- [Metric: `process.paging.faults`](#metric-processpagingfaults)

<!-- tocstop -->

Expand All @@ -43,7 +43,7 @@ metrics](/docs/runtime/README.md#metrics).
> * SHOULD introduce a control mechanism to allow users to opt-in to the new
> conventions once the migration plan is finalized.
## Metric Instruments
## Process Metrics

### Metric: `process.cpu.time`

Expand Down Expand Up @@ -122,9 +122,9 @@ metrics](/docs/runtime/README.md#metrics).
<!-- semconv metric.process.disk.io(full) -->
| Attribute | Type | Description | Examples | Requirement Level |
|---|---|---|---|---|
| `process.disk.process.disk.io_direction` | string | The direction of the data transfer for this data point. | `read` | Recommended |
| [`disk.io.direction`](../attributes-registry/disk.md) | string | The disk IO operation direction. | `read` | Recommended |

`process.disk.process.disk.io_direction` has the following list of well-known values. If one of them applies, then the respective value MUST be used, otherwise a custom value MAY be used.
`disk.io.direction` MUST be one of the following:

| Value | Description |
|---|---|
Expand All @@ -143,14 +143,14 @@ metrics](/docs/runtime/README.md#metrics).
<!-- semconv metric.process.network.io(full) -->
| Attribute | Type | Description | Examples | Requirement Level |
|---|---|---|---|---|
| `process.network.io_direction` | string | The direction of the data transfer for this data point. | `receive` | Recommended |
| [`network.io.direction`](../attributes-registry/network.md) | string | The network IO operation direction. | `transmit` | Recommended |

`process.network.io_direction` has the following list of well-known values. If one of them applies, then the respective value MUST be used, otherwise a custom value MAY be used.
`network.io.direction` MUST be one of the following:

| Value | Description |
|---|---|
| `receive` | receive |
| `transmit` | transmit |
| `receive` | receive |
<!-- endsemconv -->

### Metric: `process.thread.count`
Expand All @@ -169,7 +169,7 @@ metrics](/docs/runtime/README.md#metrics).
<!-- semconv metric.process.open_file_descriptor.count(metric_table) -->
| Name | Instrument Type | Unit (UCUM) | Description |
| -------- | --------------- | ----------- | -------------- |
| `process.open_file_descriptors` | UpDownCounter | `{count}` | Number of file descriptors in use by the process. |
| `process.open_file_descriptor.count` | UpDownCounter | `{count}` | Number of file descriptors in use by the process. |
<!-- endsemconv -->

<!-- semconv metric.process.open_file_descriptor.count(full) -->
Expand Down
4 changes: 2 additions & 2 deletions model/metrics/process-metrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ groups:
instrument: counter
unit: "{count}"
attributes:
- id: process.context_switches.type
- id: process.context_switch_type
brief: "Specifies whether the context switches for this data point were voluntary or involuntary."
type:
allow_custom_values: true
Expand All @@ -109,7 +109,7 @@ groups:
instrument: counter
unit: "{fault}"
attributes:
- id: process.paging.faults.type
- id: process.paging.fault_type
brief: "The type of page fault for this data point. Type `major` is for major/hard page faults, and `minor` is for minor/soft page faults."
type:
allow_custom_values: true
Expand Down
14 changes: 7 additions & 7 deletions proposed_changelog.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# Blah

- BREAKING: Generate process metrics from YAML
([#330](https://github.com/open-telemetry/semantic-conventions/pull/330))
- Rename attributes for `process.cpu.*`
- `state` to `process.cpu.state`
- Change attributes for `process.disk.io`
- Instead of `direction` use the global `disk.io.direction`
- Instead of `direction` use `disk.io.direction` from global registry
- Change attributes for `process.network.io`
- Instead of `direction` use `network.io.direction`
- Instead of `direction` use `network.io.direction` from global registry
- Rename `process.threads` to `process.thread.count`
- Rename `process.open_file_descriptors` to `process.open_file_descriptor.count`
- Rename `process.context_switches` to `process.context_switch.count`
- Rename attributes for `process.context_switch.count`
- `type` to `process.context_switch.type`
- Rename `process.paging.faults` to `process.paging.fault.count`
- Rename attributes for `process.context_switches`
- `type` to `process.context_switch_type`
- Rename attributes for `process.paging.faults`
- `type` to `process.paging.fault.type`
- `type` to `process.paging.fault_type`
8 changes: 4 additions & 4 deletions proposed_schema_next.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@ metrics:
- process.disk.io

Check failure on line 18 in proposed_schema_next.yaml

View workflow job for this annotation

GitHub Actions / yamllint

[indentation] wrong indentation: expected 4 but found 6
- rename_attributes:
attribute_map:
type: process.context_switch.type
type: process.context_switch_type
apply_to_metrics:
- process.context_switch.count
- process.context_switches

Check failure on line 23 in proposed_schema_next.yaml

View workflow job for this annotation

GitHub Actions / yamllint

[indentation] wrong indentation: expected 4 but found 6
- rename_attributes:
attribute_map:
direction: network.io.direction
apply_to_metrics:
- process.network.io

Check failure on line 28 in proposed_schema_next.yaml

View workflow job for this annotation

GitHub Actions / yamllint

[indentation] wrong indentation: expected 4 but found 6
- rename_attributes:
attribute_map:
type: process.paging.fault.type
type: process.paging.fault_type
apply_to_metrics:
- process.paging.fault.count
- process.paging.faults

Check failure on line 33 in proposed_schema_next.yaml

View workflow job for this annotation

GitHub Actions / yamllint

[indentation] wrong indentation: expected 4 but found 6

Check failure on line 33 in proposed_schema_next.yaml

View workflow job for this annotation

GitHub Actions / yamllint

[new-line-at-end-of-file] no new line character at the end of file

0 comments on commit d971697

Please sign in to comment.