From ae47bc35f95bb0272e9b73a3a2247b97588c8a70 Mon Sep 17 00:00:00 2001 From: Johannes Tax Date: Wed, 11 Oct 2023 17:14:37 +0100 Subject: [PATCH 1/4] Use seconds as default duration for FaaS metrics --- docs/faas/faas-metrics.md | 12 +++++++++--- model/metrics/faas-metrics.yaml | 6 +++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/docs/faas/faas-metrics.md b/docs/faas/faas-metrics.md index b64d90dd01..b3a808751f 100644 --- a/docs/faas/faas-metrics.md +++ b/docs/faas/faas-metrics.md @@ -45,10 +45,12 @@ The following metrics are recorded by the FaaS instance. This metric is [recommended][MetricRecommended]. +This metric SHOULD use [`ExplicitBucketBoundaries`](../general/metrics-general.md#explicit-bucket-boundaries-for-duration-histograms). + | Name | Instrument Type | Unit (UCUM) | Description | | -------- | --------------- | ----------- | -------------- | -| `faas.invoke_duration` | Histogram | `ms` | Measures the duration of the function's logic execution | +| `faas.invoke_duration` | Histogram | `s` | Measures the duration of the function's logic execution | @@ -71,10 +73,12 @@ This metric is [recommended][MetricRecommended]. This metric is [recommended][MetricRecommended]. +This metric SHOULD use [`ExplicitBucketBoundaries`](../general/metrics-general.md#explicit-bucket-boundaries-for-duration-histograms). + | Name | Instrument Type | Unit (UCUM) | Description | | -------- | --------------- | ----------- | -------------- | -| `faas.init_duration` | Histogram | `ms` | Measures the duration of the function's initialization, such as a cold start | +| `faas.init_duration` | Histogram | `s` | Measures the duration of the function's initialization, such as a cold start | @@ -227,10 +231,12 @@ This metric is [recommended][MetricRecommended]. This metric is [recommended][MetricRecommended]. +This metric SHOULD use [`ExplicitBucketBoundaries`](../general/metrics-general.md#explicit-bucket-boundaries-for-duration-histograms). + | Name | Instrument Type | Unit (UCUM) | Description | | -------- | --------------- | ----------- | -------------- | -| `faas.cpu_usage` | Histogram | `ms` | Distribution of CPU usage per invocation | +| `faas.cpu_usage` | Histogram | `s` | Distribution of CPU usage per invocation | diff --git a/model/metrics/faas-metrics.yaml b/model/metrics/faas-metrics.yaml index 6a753a7351..d68119f320 100644 --- a/model/metrics/faas-metrics.yaml +++ b/model/metrics/faas-metrics.yaml @@ -4,7 +4,7 @@ groups: metric_name: faas.invoke_duration brief: "Measures the duration of the function's logic execution" instrument: histogram - unit: "ms" + unit: "s" attributes: - ref: faas.trigger @@ -13,7 +13,7 @@ groups: metric_name: faas.init_duration brief: "Measures the duration of the function's initialization, such as a cold start" instrument: histogram - unit: "ms" + unit: "s" attributes: - ref: faas.trigger @@ -67,7 +67,7 @@ groups: metric_name: faas.cpu_usage brief: "Distribution of CPU usage per invocation" instrument: histogram - unit: "ms" + unit: "s" attributes: - ref: faas.trigger From b2bf1a61f8135ac1eec10722d26196cc790a2c82 Mon Sep 17 00:00:00 2001 From: Johannes Tax Date: Wed, 11 Oct 2023 17:22:14 +0100 Subject: [PATCH 2/4] Add changelog entry --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3563762c3a..0776a89e2c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -139,6 +139,8 @@ release. - BREAKING: Rename/replace `(client|server).socket.(address|port)` attributes with `network.(peer|local).(address|port)`. ([#342](https://github.com/open-telemetry/semantic-conventions/pull/342)) +- BREAKING: Use seconds as default duration for FaaS duration histograms + ([#384](https://github.com/open-telemetry/semantic-conventions/pull/384)) ## v1.21.0 (2023-07-13) From de429d6b133dc458182139df5aeb0c8477d20524 Mon Sep 17 00:00:00 2001 From: Johannes Tax Date: Wed, 11 Oct 2023 17:23:56 +0100 Subject: [PATCH 3/4] Linting issues --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0776a89e2c..fd37e1dcb6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -139,7 +139,7 @@ release. - BREAKING: Rename/replace `(client|server).socket.(address|port)` attributes with `network.(peer|local).(address|port)`. ([#342](https://github.com/open-telemetry/semantic-conventions/pull/342)) -- BREAKING: Use seconds as default duration for FaaS duration histograms +- BREAKING: Use seconds as default duration for FaaS duration histograms ([#384](https://github.com/open-telemetry/semantic-conventions/pull/384)) ## v1.21.0 (2023-07-13) From 5a86f603f1229a5d52e2d0493e4406a4d8220301 Mon Sep 17 00:00:00 2001 From: Johannes Tax Date: Wed, 11 Oct 2023 17:26:40 +0100 Subject: [PATCH 4/4] Fix bucket boundaries --- docs/faas/faas-metrics.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/docs/faas/faas-metrics.md b/docs/faas/faas-metrics.md index b3a808751f..e84a0921dc 100644 --- a/docs/faas/faas-metrics.md +++ b/docs/faas/faas-metrics.md @@ -45,7 +45,9 @@ The following metrics are recorded by the FaaS instance. This metric is [recommended][MetricRecommended]. -This metric SHOULD use [`ExplicitBucketBoundaries`](../general/metrics-general.md#explicit-bucket-boundaries-for-duration-histograms). +This metric SHOULD be specified with +[`ExplicitBucketBoundaries`](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.26.0/specification/metrics/api.md#instrument-advice) +of `[ 0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, 10 ]`. | Name | Instrument Type | Unit (UCUM) | Description | @@ -73,7 +75,9 @@ This metric SHOULD use [`ExplicitBucketBoundaries`](../general/metrics-general.m This metric is [recommended][MetricRecommended]. -This metric SHOULD use [`ExplicitBucketBoundaries`](../general/metrics-general.md#explicit-bucket-boundaries-for-duration-histograms). +This metric SHOULD be specified with +[`ExplicitBucketBoundaries`](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.26.0/specification/metrics/api.md#instrument-advice) +of `[ 0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, 10 ]`. | Name | Instrument Type | Unit (UCUM) | Description | @@ -231,7 +235,9 @@ This metric is [recommended][MetricRecommended]. This metric is [recommended][MetricRecommended]. -This metric SHOULD use [`ExplicitBucketBoundaries`](../general/metrics-general.md#explicit-bucket-boundaries-for-duration-histograms). +This metric SHOULD be specified with +[`ExplicitBucketBoundaries`](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.26.0/specification/metrics/api.md#instrument-advice) +of `[ 0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, 10 ]`. | Name | Instrument Type | Unit (UCUM) | Description |