From e10cc9a417467f219583814ebfccd3f0ded05802 Mon Sep 17 00:00:00 2001 From: Braydon Kains Date: Tue, 7 Nov 2023 10:01:20 -0600 Subject: [PATCH] rename metrics and attributes for spec compliance Rename metrics that are updowncounters to use the `.count` naming convention. Also rename attributes to not use metric names as namespaces. --- CHANGELOG.md | 30 ++--- docs/system/process-metrics.md | 170 ++++++++++++++--------------- model/metrics/process-metrics.yaml | 14 +-- schema-next.yaml | 58 +++++----- 4 files changed, 138 insertions(+), 134 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 927584f93d..9229b8881c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,9 +7,23 @@ release. ## Unreleased -<<<<<<< HEAD ### Breaking +- 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` + - Rename attributes for `process.disk.io` + - `direction` to `process.disk.io_direction` + - Rename attributes for `process.network.io` + - `direction` to `process.network.io_direction` + - Rename `process.threads` to `process.thread.count` + - Rename `process.open_file_descriptors` to `process.open_file_descriptor.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` + ### Features ### Fixes @@ -106,24 +120,10 @@ stabilized. ## v1.22.0 (2023-10-12) - Remove experimental Kafka metrics ([#338](https://github.com/open-telemetry/semantic-conventions/pull/338)) -======= ->>>>>>> 0f8b883 (adding conflict fix I forgot to save) - Adds `session.id` and session.md to general docs and model ([#215](https://github.com/open-telemetry/semantic-conventions/pull/215)) - Add `container.labels.` attributes. ([#125](https://github.com/open-telemetry/semantic-conventions/pull/125)) -- 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` - - Rename attributes for `process.disk.io` - - `direction` to `process.disk.io.direction` - - Rename attributes for `process.network.io` - - `direction` to `process.network.io.direction` - - Rename attributes for `process.context_switches` - - `type` to `process.context_switches.type` - - Rename attributes for `process.paging.faults` - - `type` to `process.paging.faults.type` - Add `cluster.name` and `node.name` attributes to Elasticsearch semantic conventions. ([#285](https://github.com/open-telemetry/semantic-conventions/pull/285)) - Fix the unit of metric.process.runtime.jvm.system.cpu.load_1m to be {run_queue_item} diff --git a/docs/system/process-metrics.md b/docs/system/process-metrics.md index 4c5ba7d2a3..209cb3c94d 100644 --- a/docs/system/process-metrics.md +++ b/docs/system/process-metrics.md @@ -27,8 +27,8 @@ metrics](/docs/runtime/README.md#metrics). - [Metric: `process.memory.virtual`](#metric-processmemoryvirtual) - [Metric: `process.disk.io`](#metric-processdiskio) - [Metric: `process.network.io`](#metric-processnetworkio) - - [Metric: `process.threads`](#metric-processthreads) - - [Metric: `process.open_file_descriptors`](#metric-processopen_file_descriptors) + - [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) @@ -39,53 +39,53 @@ metrics](/docs/runtime/README.md#metrics). ### Metric: `process.cpu.time` -| Name | Instrument Type | Unit (UCUM) | Description | -| ------------------ | --------------- | ----------- | -------------------------------------------------- | -| `process.cpu.time` | Counter | `s` | Total CPU seconds broken down by different states. | +| Name | Instrument Type | Unit (UCUM) | Description | +| -------- | --------------- | ----------- | -------------- | +| `process.cpu.time` | Counter | `s` | Total CPU seconds broken down by different states. | -| Attribute | Type | Description | Examples | Requirement Level | -| ------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | ----------------- | -| `process.cpu.state` | string | The CPU state for this data point. A process SHOULD be characterized _either_ by data points with no `state` labels, _or only_ data points with `state` labels. | `system` | Recommended | +| Attribute | Type | Description | Examples | Requirement Level | +|---|---|---|---|---| +| `process.cpu.state` | string | The CPU state for this data point. A process SHOULD be characterized _either_ by data points with no `state` labels, _or only_ data points with `state` labels. | `system` | Recommended | `process.cpu.state` 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. -| Value | Description | -| -------- | ----------- | -| `system` | system | -| `user` | user | -| `wait` | wait | +| Value | Description | +|---|---| +| `system` | system | +| `user` | user | +| `wait` | wait | ### Metric: `process.cpu.utilization` -| Name | Instrument Type | Unit (UCUM) | Description | -| ------------------------- | --------------- | ----------- | ----------------------------------------------------------------------------------------------------------------------------------- | -| `process.cpu.utilization` | Gauge | `1` | Difference in process.cpu.time since the last measurement, divided by the elapsed time and number of CPUs available to the process. | +| Name | Instrument Type | Unit (UCUM) | Description | +| -------- | --------------- | ----------- | -------------- | +| `process.cpu.utilization` | Gauge | `1` | Difference in process.cpu.time since the last measurement, divided by the elapsed time and number of CPUs available to the process. | -| Attribute | Type | Description | Examples | Requirement Level | -| ------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | ----------------- | -| `process.cpu.state` | string | The CPU state for this data point. A process SHOULD be characterized _either_ by data points with no `state` labels, _or only_ data points with `state` labels. | `system` | Recommended | +| Attribute | Type | Description | Examples | Requirement Level | +|---|---|---|---|---| +| `process.cpu.state` | string | The CPU state for this data point. A process SHOULD be characterized _either_ by data points with no `state` labels, _or only_ data points with `state` labels. | `system` | Recommended | `process.cpu.state` 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. -| Value | Description | -| -------- | ----------- | -| `system` | system | -| `user` | user | -| `wait` | wait | +| Value | Description | +|---|---| +| `system` | system | +| `user` | user | +| `wait` | wait | ### Metric: `process.memory.usage` -| Name | Instrument Type | Unit (UCUM) | Description | -| ---------------------- | --------------- | ----------- | ------------------------------------- | -| `process.memory.usage` | UpDownCounter | `By` | The amount of physical memory in use. | +| Name | Instrument Type | Unit (UCUM) | Description | +| -------- | --------------- | ----------- | -------------- | +| `process.memory.usage` | UpDownCounter | `By` | The amount of physical memory in use. | @@ -94,9 +94,9 @@ metrics](/docs/runtime/README.md#metrics). ### Metric: `process.memory.virtual` -| Name | Instrument Type | Unit (UCUM) | Description | -| ------------------------ | --------------- | ----------- | --------------------------------------- | -| `process.memory.virtual` | UpDownCounter | `By` | The amount of committed virtual memory. | +| Name | Instrument Type | Unit (UCUM) | Description | +| -------- | --------------- | ----------- | -------------- | +| `process.memory.virtual` | UpDownCounter | `By` | The amount of committed virtual memory. | @@ -105,107 +105,107 @@ metrics](/docs/runtime/README.md#metrics). ### Metric: `process.disk.io` -| Name | Instrument Type | Unit (UCUM) | Description | -| ----------------- | --------------- | ----------- | ----------------------- | -| `process.disk.io` | Counter | `By` | Disk bytes transferred. | +| Name | Instrument Type | Unit (UCUM) | Description | +| -------- | --------------- | ----------- | -------------- | +| `process.disk.io` | Counter | `By` | Disk bytes transferred. | -| 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 | +| 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 | -`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. +`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. -| Value | Description | -| ------- | ----------- | -| `read` | read | -| `write` | write | +| Value | Description | +|---|---| +| `read` | read | +| `write` | write | ### Metric: `process.network.io` -| Name | Instrument Type | Unit (UCUM) | Description | -| -------------------- | --------------- | ----------- | -------------------------- | -| `process.network.io` | Counter | `By` | Network bytes transferred. | +| Name | Instrument Type | Unit (UCUM) | Description | +| -------- | --------------- | ----------- | -------------- | +| `process.network.io` | Counter | `By` | Network bytes transferred. | -| Attribute | Type | Description | Examples | Requirement Level | -| ------------------------------ | ------ | ------------------------------------------------------- | --------- | ----------------- | -| `process.network.io.direction` | string | The direction of the data transfer for this data point. | `receive` | Recommended | +| Attribute | Type | Description | Examples | Requirement Level | +|---|---|---|---|---| +| `process.network.io_direction` | string | The direction of the data transfer for this data point. | `receive` | 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. +`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. -| Value | Description | -| ---------- | ----------- | -| `receive` | receive | -| `transmit` | transmit | +| Value | Description | +|---|---| +| `receive` | receive | +| `transmit` | transmit | -### Metric: `process.threads` +### Metric: `process.thread.count` - -| Name | Instrument Type | Unit (UCUM) | Description | -| ----------------- | --------------- | ----------- | ---------------------- | -| `process.threads` | UpDownCounter | `{thread}` | Process threads count. | + +| Name | Instrument Type | Unit (UCUM) | Description | +| -------- | --------------- | ----------- | -------------- | +| `process.thread.count` | UpDownCounter | `{thread}` | Process threads count. | - + -### Metric: `process.open_file_descriptors` +### Metric: `process.open_file_descriptor.count` - -| Name | Instrument Type | Unit (UCUM) | Description | -| ------------------------------- | --------------- | ----------- | ------------------------------------------------- | -| `process.open_file_descriptors` | UpDownCounter | `{count}` | Number of file descriptors in use by the process. | + +| Name | Instrument Type | Unit (UCUM) | Description | +| -------- | --------------- | ----------- | -------------- | +| `process.open_file_descriptors` | UpDownCounter | `{count}` | Number of file descriptors in use by the process. | - + ### Metric: `process.context_switches` -| Name | Instrument Type | Unit (UCUM) | Description | -| -------------------------- | --------------- | ----------- | ------------------------------------------------------ | -| `process.context_switches` | Counter | `{count}` | Number of times the process has been context switched. | +| Name | Instrument Type | Unit (UCUM) | Description | +| -------- | --------------- | ----------- | -------------- | +| `process.context_switches` | Counter | `{count}` | Number of times the process has been context switched. | -| Attribute | Type | Description | Examples | Requirement Level | -| ------------------------------- | ------ | ----------------------------------------------------------------------------------------- | ----------- | ----------------- | -| `process.context_switches.type` | string | Specifies whether the context switches for this data point were voluntary or involuntary. | `voluntary` | Recommended | +| Attribute | Type | Description | Examples | Requirement Level | +|---|---|---|---|---| +| `process.context_switch_type` | string | Specifies whether the context switches for this data point were voluntary or involuntary. | `voluntary` | Recommended | -`process.context_switches.type` 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. +`process.context_switch_type` 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. -| Value | Description | -| ------------- | ----------- | -| `voluntary` | voluntary | +| Value | Description | +|---|---| +| `voluntary` | voluntary | | `involuntary` | involuntary | ### Metric: `process.paging.faults` -| Name | Instrument Type | Unit (UCUM) | Description | -| ----------------------- | --------------- | ----------- | ------------------------------------------- | -| `process.paging.faults` | Counter | `{fault}` | Number of page faults the process has made. | +| Name | Instrument Type | Unit (UCUM) | Description | +| -------- | --------------- | ----------- | -------------- | +| `process.paging.faults` | Counter | `{fault}` | Number of page faults the process has made. | -| Attribute | Type | Description | Examples | Requirement Level | -| ---------------------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------- | -------- | ----------------- | -| `process.paging.faults.type` | string | 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. | `major` | Recommended | +| Attribute | Type | Description | Examples | Requirement Level | +|---|---|---|---|---| +| `process.paging.fault_type` | string | 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. | `major` | Recommended | -`process.paging.faults.type` 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. +`process.paging.fault_type` 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. -| Value | Description | -| ------- | ----------- | -| `major` | major | -| `minor` | minor | +| Value | Description | +|---|---| +| `major` | major | +| `minor` | minor | [DocumentStatus]: https://github.com/open-telemetry/opentelemetry-specification/tree/v1.26.0/specification/document-status.md diff --git a/model/metrics/process-metrics.yaml b/model/metrics/process-metrics.yaml index ce923afc7f..7ccc0f3549 100644 --- a/model/metrics/process-metrics.yaml +++ b/model/metrics/process-metrics.yaml @@ -58,7 +58,7 @@ groups: instrument: counter unit: "By" attributes: - - id: process.disk.io.direction + - id: process.disk.io_direction brief: "The direction of the data transfer for this data point." type: allow_custom_values: true @@ -75,7 +75,7 @@ groups: instrument: counter unit: "By" attributes: - - id: process.network.io.direction + - id: process.network.io_direction brief: "The direction of the data transfer for this data point." type: allow_custom_values: true @@ -85,15 +85,15 @@ groups: - id: transmit value: 'transmit' - - id: metric.process.threads + - id: metric.process.thread.count type: metric - metric_name: process.threads + metric_name: process.thread.count brief: "Process threads count." instrument: updowncounter unit: "{thread}" attributes: [] - - id: metric.process.open_file_descriptors + - id: metric.process.open_file_descriptor.count type: metric metric_name: process.open_file_descriptors brief: "Number of file descriptors in use by the process." @@ -108,7 +108,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 @@ -125,7 +125,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 diff --git a/schema-next.yaml b/schema-next.yaml index dcc8d3b3b7..18332c3e94 100644 --- a/schema-next.yaml +++ b/schema-next.yaml @@ -2,6 +2,37 @@ file_format: 1.1.0 schema_url: https://opentelemetry.io/schemas/next versions: next: + metrics: + # https://github.com/open-telemetry/semantic-conventions/pull/330 + - rename_attributes: + attribute_map: + state: process.cpu.state + apply_to_metrics: + - process.cpu.time + - process.cpu.utilization + - rename_attributes: + attribute_map: + direction: process.disk.io_direction + apply_to_metrics: + - process.disk.io + - rename_attributes: + attribute_map: + type: process.context_switch_type + apply_to_metrics: + - process.context_switches + - rename_attributes: + attribute_map: + direction: process.network.io_direction + apply_to_metrics: + - process.network.io + - rename_attributes: + attribute_map: + type: process.paging.fault_type + apply_to_metrics: + - process.paging.faults + - rename_metrics: + process.threads: process.thread.count + process.open_file_descriptors: process.open_file_descriptor.count 1.23.0: metrics: changes: @@ -151,33 +182,6 @@ versions: - rename_metrics: http.server.request.size: http.server.request.body.size http.server.response.size: http.server.response.body.size - # https://github.com/open-telemetry/semantic-conventions/pull/330 - - rename_attributes: - attribute_map: - state: process.cpu.state - apply_to_metrics: - - process.cpu.time - - process.cpu.utilization - - rename_attributes: - attribute_map: - direction: process.disk.io.direction - apply_to_metrics: - - process.disk.io - - rename_attributes: - attribute_map: - type: process.context_switches.type - apply_to_metrics: - - process.context_switches - - rename_attributes: - attribute_map: - direction: process.network.io.direction - apply_to_metrics: - - process.network.io - - rename_attributes: - attribute_map: - type: process.paging.faults.type - apply_to_metrics: - - process.paging.faults resources: changes: # https://github.com/open-telemetry/semantic-conventions/pull/178