Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
skonto committed Jun 9, 2021
1 parent 9a7b64a commit 1382518
Showing 1 changed file with 29 additions and 21 deletions.
50 changes: 29 additions & 21 deletions specification/metrics/semantic_conventions/faas-metrics.md
Original file line number Diff line number Diff line change
@@ -1,49 +1,57 @@
# General

The conventions described in this section aim both Functions running as a service (FaaS) and on-premise setups. When Functions are operated, metric events about those operations will be generated and reported to provide insight into the
operations. By adding Functions dedicated labels to metric events it allows for finely tuned filtering.
The conventions described in this section are FaaS (function as a service) specific. When FaaS operations occur,
metric events about those operations will be generated and reported to provide insights into the
operations. By adding FaaS labels to metric events it allows for finely tuned filtering.

**Disclaimer:** These are initial Function metric instruments and labels but more may be added in the future. Not all instruments
apply to all environments.
**Disclaimer:** These are initial FaaS metric instruments and labels but more may be added in the future.

## Metric Instruments

The following metric instruments MUST be used to describe Function operations. They MUST be of the specified
The following metric instruments MUST be used to describe FaaS operations. They MUST be of the specified
type and units.

### Function Invocations
### FaaS Invocations

Below is a table of Function invocation metric instruments.
Below is a table of FaaS invocation metric instruments.

| Name | Instrument | Units | Description |
|------|------------|-------|-------------|
| `func.invoke_duration` | ValueRecorder | milliseconds | Measures the duration of the invocation where real work is being done. |
| `func.init_duration` | ValueRecorder | milliseconds | Measures the duration of the function's initialization, such as a cold start |
| `func.coldstarts` | Counter | number of cold starts | Number of invocation cold starts. |
| `func.errors` | Counter | number of errors | Number of invocation errors. |
| `func.executions` | Counter | number of invocations | number of successful invocations. |
| `func.timeouts` | Counter | number of timeouts | number of invocation timeouts. |
|------|------------|----|-------------|
| `faas.invoke_duration` | ValueRecorder | milliseconds | Measures the duration of the invocation |
| `faas.init_duration` | ValueRecorder | milliseconds | Measures the duration of the function's initialization, such as a cold start |
| `faas.coldstarts` | Counter | default unit | Number of invocation cold starts. |
| `faas.errors` | Counter | default unit | Number of invocation errors. |
| `faas.executions` | Counter | default unit | Number of successful invocations. |
| `faas.timeouts` | Counter | default unit | Number of invocation timeouts. |

Optionally, when applicable:

| Name | Instrument | Units | Description |
|------|------------|----|-------------|
| `faas.mem_usage` | ValueRecorder | bytes | Distribution of max memory usage per invocation |
| `faas.cpu_usage` | ValueRecorder | milliseconds | Distribution of cpu usage per invocation |
| `faas.net_io` | ValueRecorder | bytes | Distribution of net I/O usage per invocation |

## Labels

Below is a table of the labels that SHOULD be included on Func metric events if applicable.
Below is a table of the labels that SHOULD be included on FaaS metric events.

| Name | Recommended | Notes and examples |
|------|-------------|--------------------|
| `func.trigger` | Yes | Type of the trigger on which the function is invoked. SHOULD be one of: `datasource`, `http`, `pubsub`, `timer`, `other` |
| `func.invoked_name` | Yes | Name of the invoked function. Example: `my-function` |
| `func.invoked_provider` | Yes | Cloud provider of the invoked function. Corresponds to the resource `cloud.provider`. Example: `aws` |
| `func.invoked_region` | Yes | Cloud provider region of invoked function. Corresponds to resource `cloud.region`. Example: `us-east-1` |
| `faas.trigger` | Yes | Type of the trigger on which the function is invoked. SHOULD be one of: `datasource`, `http`, `pubsub`, `timer`, `other` |
| `faas.invoked_name` | Yes | Name of the invoked function. Example: `my-function` |
| `faas.invoked_provider` | Yes | Cloud provider of the invoked function. Corresponds to the resource `cloud.provider`. Example: `aws` |
| `faas.invoked_region` | Yes | Cloud provider region of invoked function. Corresponds to resource `cloud.region`. Example: `us-east-1` |

## References

### Metric Reference

Below are links to documentation regarding metrics that are available with different
FaaS providers and other vendors. This list is not exhaustive.
FaaS providers. This list is not exhaustive.

* [AWS Lambda Metrics](https://docs.aws.amazon.com/lambda/latest/dg/monitoring-metrics.html)
* [AWS Lambda Insight Metrics](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Lambda-Insights-metrics.html)
* [Azure Functions Metrics](https://docs.microsoft.com/en-us/azure/azure-monitor/platform/metrics-supported)
* [Google CloudFunctions Metrics](https://cloud.google.com/monitoring/api/metrics_gcp#gcp-cloudfunctions)
* [OpenFaas Metrics](https://docs.openfaas.com/architecture/metrics/)
* [Openwhisk Metrics](https://github.com/apache/openwhisk/blob/master/docs/metrics.md)

0 comments on commit 1382518

Please sign in to comment.