Skip to content

Commit

Permalink
Explain meaning of "instrument type"
Browse files Browse the repository at this point in the history
Signed-off-by: Fabian Stäber <fabian@fstab.de>
  • Loading branch information
fstab committed Apr 1, 2022
1 parent 89aef8d commit 87f4e80
Show file tree
Hide file tree
Showing 7 changed files with 117 additions and 108 deletions.
9 changes: 9 additions & 0 deletions specification/metrics/semantic_conventions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
- [General Metric Semantic Conventions](#general-metric-semantic-conventions)
* [Instrument Naming](#instrument-naming)
* [Instrument Units](#instrument-units)
* [Instrument Types](#instrument-types)

<!-- tocstop -->

Expand Down Expand Up @@ -165,3 +166,11 @@ total) are dimensionless and SHOULD use the default unit `1` (the unity).
[annotations](https://ucum.org/ucum.html#para-curly) with curly braces to
give additional meaning *without* the leading default unit (`1`). For example,
use `{packets}`, `{errors}`, `{faults}`, etc.

### Instrument Types

The semantic metric conventions specification is written to use names of the synchronous instrument types,
like `Counter` or `UpDownCounter`. However, compliant implementations MAY use the asynchronous equivalent instead,
like `Asynchronous Counter` or `Asynchronous UpDownCounter`.
Whether implementations choose the synchronous type or the asynchronous equivalent is considered to be an
implementation detail. Both choices are compliant with this specification.
26 changes: 13 additions & 13 deletions specification/metrics/semantic_conventions/faas-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,22 +32,22 @@ type and units.

Below is a table of FaaS invocation metric instruments.

| Name | Instrument | Unit | Unit ([UCUM](README.md#instrument-units)) | Description |
|------------------------|------------|--------------|-------------------------------------------|------------------------------------------------------------------------------|
| `faas.invoke_duration` | Histogram | milliseconds | `ms` | Measures the duration of the invocation |
| `faas.init_duration` | Histogram | milliseconds | `ms` | Measures the duration of the function's initialization, such as a cold start |
| `faas.coldstarts` | Counter | default unit | `{coldstarts}` | Number of invocation cold starts. |
| `faas.errors` | Counter | default unit | `{errors}` | Number of invocation errors. |
| `faas.executions` | Counter | default unit | `{executions}` | Number of successful invocations. |
| `faas.timeouts` | Counter | default unit | `{timeouts}` | Number of invocation timeouts. |
| Name | Instrument Type ([*](README.md#instrument-types)) | Unit | Unit ([UCUM](README.md#instrument-units)) | Description |
|------------------------|---------------------------------------------------|--------------|-------------------------------------------|------------------------------------------------------------------------------|
| `faas.invoke_duration` | Histogram | milliseconds | `ms` | Measures the duration of the invocation |
| `faas.init_duration` | Histogram | milliseconds | `ms` | Measures the duration of the function's initialization, such as a cold start |
| `faas.coldstarts` | Counter | default unit | `{coldstarts}` | Number of invocation cold starts. |
| `faas.errors` | Counter | default unit | `{errors}` | Number of invocation errors. |
| `faas.executions` | Counter | default unit | `{executions}` | Number of successful invocations. |
| `faas.timeouts` | Counter | default unit | `{timeouts}` | Number of invocation timeouts. |

Optionally, when applicable:

| Name | Instrument | Unit | Unit ([UCUM](README.md#instrument-units)) | Description |
|------------------|------------|--------------|-------------------------------------------|-------------------------------------------------|
| `faas.mem_usage` | Histogram | Bytes | `By` | Distribution of max memory usage per invocation |
| `faas.cpu_usage` | Histogram | milliseconds | `ms` | Distribution of cpu usage per invocation |
| `faas.net_io` | Histogram | Bytes | `By` | Distribution of net I/O usage per invocation |
| Name | Instrument Type ([*](README.md#instrument-types)) | Unit | Unit ([UCUM](README.md#instrument-units)) | Description |
|------------------|---------------------------------------------------|--------------|-------------------------------------------|-------------------------------------------------|
| `faas.mem_usage` | Histogram | Bytes | `By` | Distribution of max memory usage per invocation |
| `faas.cpu_usage` | Histogram | milliseconds | `ms` | Distribution of cpu usage per invocation |
| `faas.net_io` | Histogram | Bytes | `By` | Distribution of net I/O usage per invocation |

## Attributes

Expand Down
14 changes: 7 additions & 7 deletions specification/metrics/semantic_conventions/http-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@ type and units.

Below is a table of HTTP server metric instruments.

| Name | Instrument | Unit | Unit ([UCUM](README.md#instrument-units)) | Description |
|-------------------------------|---------------|--------------|-------------------------------------------|------------------------------------------------------------------------------|
| `http.server.duration` | Histogram | milliseconds | `ms` | measures the duration of the inbound HTTP request |
| `http.server.active_requests` | UpDownCounter | requests | `{requests}` | measures the number of concurrent HTTP requests that are currently in-flight |
| Name | Instrument Type ([*](README.md#instrument-types)) | Unit | Unit ([UCUM](README.md#instrument-units)) | Description |
|-------------------------------|---------------------------------------------------|--------------|-------------------------------------------|------------------------------------------------------------------------------|
| `http.server.duration` | Histogram | milliseconds | `ms` | measures the duration of the inbound HTTP request |
| `http.server.active_requests` | UpDownCounter | requests | `{requests}` | measures the number of concurrent HTTP requests that are currently in-flight |

### HTTP Client

Below is a table of HTTP client metric instruments.

| Name | Instrument | Unit | Unit ([UCUM](README.md#instrument-units)) | Description |
|------------------------|------------|--------------|-------------------------------------------|----------------------------------------------------|
| `http.client.duration` | Histogram | milliseconds | `ms` | measures the duration of the outbound HTTP request |
| Name | Instrument Type ([*](README.md#instrument-types)) | Unit | Unit ([UCUM](README.md#instrument-units)) | Description |
|------------------------|---------------------------------------------------|--------------|-------------------------------------------|----------------------------------------------------|
| `http.client.duration` | Histogram | milliseconds | `ms` | measures the duration of the outbound HTTP request |

## Attributes

Expand Down
14 changes: 7 additions & 7 deletions specification/metrics/semantic_conventions/process-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ metrics](runtime-environment-metrics.md).

Below is a table of Process metric instruments.

| Name | Instrument | Units | Description | Labels |
|---------------------------|---------------|-------|-------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `process.cpu.time` | Counter | s | Total CPU seconds broken down by different states. | `state`, if specified, SHOULD be one of: `system`, `user`, `wait`. A process SHOULD be characterized _either_ by data points with no `state` labels, _or only_ data points with `state` labels. |
| `process.cpu.utilization` | Gauge | s | Difference in process.cpu.time since the last measurement, divided by the elapsed time and number of CPUs available to the process. | `state`, if specified, SHOULD be one of: `system`, `user`, `wait`. A process SHOULD be characterized _either_ by data points with no `state` labels, _or only_ data points with `state` labels. |
| `process.memory.usage` | UpDownCounter | By | The amount of physical memory in use. | |
| `process.memory.virtual` | UpDownCounter | By | The amount of committed virtual memory. | |
| `process.disk.io` | Counter | By | Disk bytes transferred. | `direction` SHOULD be one of: `read`, `write` |
| Name | Instrument Type ([*](README.md#instrument-types)) | Units | Description | Labels |
|---------------------------|---------------------------------------------------|-------|-------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `process.cpu.time` | Counter | s | Total CPU seconds broken down by different states. | `state`, if specified, SHOULD be one of: `system`, `user`, `wait`. A process SHOULD be characterized _either_ by data points with no `state` labels, _or only_ data points with `state` labels. |
| `process.cpu.utilization` | Gauge | s | Difference in process.cpu.time since the last measurement, divided by the elapsed time and number of CPUs available to the process. | `state`, if specified, SHOULD be one of: `system`, `user`, `wait`. A process SHOULD be characterized _either_ by data points with no `state` labels, _or only_ data points with `state` labels. |
| `process.memory.usage` | UpDownCounter | By | The amount of physical memory in use. | |
| `process.memory.virtual` | UpDownCounter | By | The amount of committed virtual memory. | |
| `process.disk.io` | Counter | By | Disk bytes transferred. | `direction` SHOULD be one of: `read`, `write` |

## Attributes

Expand Down
Loading

0 comments on commit 87f4e80

Please sign in to comment.