Semantic Conventions for FaaS Metrics

Status: Experimental

This document defines how to describe an instance of a function that runs without provisioning or managing of servers (also known as serverless functions or Function as a Service (FaaS)) with metrics.

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 attributes to metric events it allows for finely tuned filtering.

Metric Instruments

The following metric instruments describe FaaS operations.

FaaS Instance

The following metrics are recorded by the FaaS instance.

Metric: faas.invoke_duration

This metric is recommended.

This metric SHOULD be specified with ExplicitBucketBoundaries 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 ].

NameInstrument TypeUnit (UCUM)DescriptionStability
faas.invoke_durationHistogramsMeasures the duration of the function’s logic executionExperimental
AttributeTypeDescriptionExamplesRequirement LevelStability
faas.triggerstringType of the trigger which caused this function invocation.datasourceRecommendedExperimental

faas.trigger MUST be one of the following:

ValueDescriptionStability
datasourceA response to some data source operation such as a database or filesystem read/writeExperimental
httpTo provide an answer to an inbound HTTP requestExperimental
pubsubA function is set to be executed when messages are sent to a messaging systemExperimental
timerA function is scheduled to be executed regularlyExperimental
otherIf none of the others applyExperimental

Metric: faas.init_duration

This metric is recommended.

This metric SHOULD be specified with ExplicitBucketBoundaries 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 ].

NameInstrument TypeUnit (UCUM)DescriptionStability
faas.init_durationHistogramsMeasures the duration of the function’s initialization, such as a cold startExperimental
AttributeTypeDescriptionExamplesRequirement LevelStability
faas.triggerstringType of the trigger which caused this function invocation.datasourceRecommendedExperimental

faas.trigger MUST be one of the following:

ValueDescriptionStability
datasourceA response to some data source operation such as a database or filesystem read/writeExperimental
httpTo provide an answer to an inbound HTTP requestExperimental
pubsubA function is set to be executed when messages are sent to a messaging systemExperimental
timerA function is scheduled to be executed regularlyExperimental
otherIf none of the others applyExperimental

Metric: faas.coldstarts

This metric is recommended.

NameInstrument TypeUnit (UCUM)DescriptionStability
faas.coldstartsCounter{coldstart}Number of invocation cold startsExperimental
AttributeTypeDescriptionExamplesRequirement LevelStability
faas.triggerstringType of the trigger which caused this function invocation.datasourceRecommendedExperimental

faas.trigger MUST be one of the following:

ValueDescriptionStability
datasourceA response to some data source operation such as a database or filesystem read/writeExperimental
httpTo provide an answer to an inbound HTTP requestExperimental
pubsubA function is set to be executed when messages are sent to a messaging systemExperimental
timerA function is scheduled to be executed regularlyExperimental
otherIf none of the others applyExperimental

Metric: faas.errors

This metric is recommended.

NameInstrument TypeUnit (UCUM)DescriptionStability
faas.errorsCounter{error}Number of invocation errorsExperimental
AttributeTypeDescriptionExamplesRequirement LevelStability
faas.triggerstringType of the trigger which caused this function invocation.datasourceRecommendedExperimental

faas.trigger MUST be one of the following:

ValueDescriptionStability
datasourceA response to some data source operation such as a database or filesystem read/writeExperimental
httpTo provide an answer to an inbound HTTP requestExperimental
pubsubA function is set to be executed when messages are sent to a messaging systemExperimental
timerA function is scheduled to be executed regularlyExperimental
otherIf none of the others applyExperimental

Metric: faas.invocations

This metric is recommended.

NameInstrument TypeUnit (UCUM)DescriptionStability
faas.invocationsCounter{invocation}Number of successful invocationsExperimental
AttributeTypeDescriptionExamplesRequirement LevelStability
faas.triggerstringType of the trigger which caused this function invocation.datasourceRecommendedExperimental

faas.trigger MUST be one of the following:

ValueDescriptionStability
datasourceA response to some data source operation such as a database or filesystem read/writeExperimental
httpTo provide an answer to an inbound HTTP requestExperimental
pubsubA function is set to be executed when messages are sent to a messaging systemExperimental
timerA function is scheduled to be executed regularlyExperimental
otherIf none of the others applyExperimental

Metric: faas.timeouts

This metric is recommended.

NameInstrument TypeUnit (UCUM)DescriptionStability
faas.timeoutsCounter{timeout}Number of invocation timeoutsExperimental
AttributeTypeDescriptionExamplesRequirement LevelStability
faas.triggerstringType of the trigger which caused this function invocation.datasourceRecommendedExperimental

faas.trigger MUST be one of the following:

ValueDescriptionStability
datasourceA response to some data source operation such as a database or filesystem read/writeExperimental
httpTo provide an answer to an inbound HTTP requestExperimental
pubsubA function is set to be executed when messages are sent to a messaging systemExperimental
timerA function is scheduled to be executed regularlyExperimental
otherIf none of the others applyExperimental

Metric: faas.mem_usage

This metric is recommended.

NameInstrument TypeUnit (UCUM)DescriptionStability
faas.mem_usageHistogramByDistribution of max memory usage per invocationExperimental
AttributeTypeDescriptionExamplesRequirement LevelStability
faas.triggerstringType of the trigger which caused this function invocation.datasourceRecommendedExperimental

faas.trigger MUST be one of the following:

ValueDescriptionStability
datasourceA response to some data source operation such as a database or filesystem read/writeExperimental
httpTo provide an answer to an inbound HTTP requestExperimental
pubsubA function is set to be executed when messages are sent to a messaging systemExperimental
timerA function is scheduled to be executed regularlyExperimental
otherIf none of the others applyExperimental

Metric: faas.cpu_usage

This metric is recommended.

This metric SHOULD be specified with ExplicitBucketBoundaries 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 ].

NameInstrument TypeUnit (UCUM)DescriptionStability
faas.cpu_usageHistogramsDistribution of CPU usage per invocationExperimental
AttributeTypeDescriptionExamplesRequirement LevelStability
faas.triggerstringType of the trigger which caused this function invocation.datasourceRecommendedExperimental

faas.trigger MUST be one of the following:

ValueDescriptionStability
datasourceA response to some data source operation such as a database or filesystem read/writeExperimental
httpTo provide an answer to an inbound HTTP requestExperimental
pubsubA function is set to be executed when messages are sent to a messaging systemExperimental
timerA function is scheduled to be executed regularlyExperimental
otherIf none of the others applyExperimental

Metric: faas.net_io

This metric is recommended.

NameInstrument TypeUnit (UCUM)DescriptionStability
faas.net_ioHistogramByDistribution of net I/O usage per invocationExperimental
AttributeTypeDescriptionExamplesRequirement LevelStability
faas.triggerstringType of the trigger which caused this function invocation.datasourceRecommendedExperimental

faas.trigger MUST be one of the following:

ValueDescriptionStability
datasourceA response to some data source operation such as a database or filesystem read/writeExperimental
httpTo provide an answer to an inbound HTTP requestExperimental
pubsubA function is set to be executed when messages are sent to a messaging systemExperimental
timerA function is scheduled to be executed regularlyExperimental
otherIf none of the others applyExperimental

References

Metric References

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