[comment]: <> (Code generated by mdatagen. DO NOT EDIT.)

# samplemigration

## Default Metrics

The following metrics are emitted by default. Each of them can be disabled by applying the following configuration:

```yaml
metrics:
  <metric_name>:
    enabled: false
```

### system.cpu.utilization

CPU utilization as a ratio.

| Unit | Metric Type | Value Type | Stability |
| ---- | ----------- | ---------- | --------- |
| 1 | Gauge | Double | Beta |

#### Migration

- Target Metric: `system.cpu.utilization@v1`
- Disable Old Gate: `scraper.samplemigration.DontEmitV0SystemConventions`
- Enable New Gate: `scraper.samplemigration.EmitV1SystemConventions`

When the disable-old gate is enabled, emission of this metric is suppressed. When the enable-new gate is enabled, the target metric is emitted. If both gates are disabled, only this metric is emitted; if both are enabled, only the target metric is emitted.

#### Attributes

| Name | Description | Values | Requirement Level | Semantic Convention |
| ---- | ----------- | ------ | ----------------- | ------------------- |
| cpu | Logical CPU number starting at 0. | Any Str | Recommended | - |
| state | Breakdown of CPU usage by type. | Str: ``idle``, ``interrupt``, ``nice``, ``softirq``, ``steal``, ``system``, ``user``, ``wait`` | Recommended | - |

## Optional Metrics

The following metrics are not emitted by default. Each of them can be enabled by applying the following configuration:

```yaml
metrics:
  <metric_name>:
    enabled: true
```

### linux.memory.available

Legacy Linux available memory estimate.

| Unit | Metric Type | Value Type | Aggregation Temporality | Monotonic | Stability |
| ---- | ----------- | ---------- | ----------------------- | --------- | --------- |
| By | Sum | Int | Cumulative | false | Beta |

#### Migration

- Target Metric: `system.memory.linux.available@v1`
- Disable Old Gate: `scraper.samplemigration.DontEmitV0SystemConventions`
- Enable New Gate: `scraper.samplemigration.EmitV1SystemConventions`

When the disable-old gate is enabled, emission of this metric is suppressed. When the enable-new gate is enabled, the target metric is emitted. If both gates are disabled, only this metric is emitted; if both are enabled, only the target metric is emitted.

### system.cpu.foo

Example v1-only metric, disabled by default.

| Unit | Metric Type | Value Type | Stability |
| ---- | ----------- | ---------- | --------- |
| 1 | Gauge | Double | Beta |

### system.cpu.utilization@v1

CPU utilization as a monotonic cumulative sum.

| Unit | Metric Type | Value Type | Aggregation Temporality | Monotonic | Stability |
| ---- | ----------- | ---------- | ----------------------- | --------- | --------- |
| 1 | Sum | Double | Cumulative | true | Beta |

Emitted Name: `system.cpu.utilization`

#### Attributes

| Name | Description | Values | Requirement Level | Semantic Convention |
| ---- | ----------- | ------ | ----------------- | ------------------- |
| cpu.logical_number | The logical CPU number [0, n-1]. | Any Int | Recommended | - |
| cpu.mode | The CPU mode for this data point. | Str: ``system``, ``user``, ``iowait`` | Recommended | - |

### system.memory.linux.available@v1

An estimate of how much memory is available without swapping. (Linux only)

| Unit | Metric Type | Value Type | Aggregation Temporality | Monotonic | Stability |
| ---- | ----------- | ---------- | ----------------------- | --------- | --------- |
| By | Sum | Int | Cumulative | false | Beta |

Emitted Name: `system.memory.linux.available`

## Feature Gates

This component has the following feature gates:

| Feature Gate | Stage | Description | From Version | To Version | Reference |
| ------------ | ----- | ----------- | ------------ | ---------- | --------- |
| `scraper.samplemigration.DontEmitV0SystemConventions` | alpha | When enabled, semconv legacy attributes are disabled. | v0.145.0 | N/A | [Link](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/45592) |
| `scraper.samplemigration.EmitV1SystemConventions` | alpha | When enabled, semconv stable attributes are enabled. | v0.145.0 | N/A | [Link](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/45592) |

For more information about feature gates, see the [Feature Gates](https://github.com/open-telemetry/opentelemetry-collector/blob/main/featuregate/README.md) documentation.
