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.datasource; http; pubsubRecommendedExperimental

faas.trigger has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.

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
otherIf none of the others applyExperimental
pubsubA function is set to be executed when messages are sent to a messaging systemExperimental
timerA function is scheduled to be executed regularlyExperimental

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.datasource; http; pubsubRecommendedExperimental

faas.trigger has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.

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
otherIf none of the others applyExperimental
pubsubA function is set to be executed when messages are sent to a messaging systemExperimental
timerA function is scheduled to be executed regularlyExperimental

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.datasource; http; pubsubRecommendedExperimental

faas.trigger has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.

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
otherIf none of the others applyExperimental
pubsubA function is set to be executed when messages are sent to a messaging systemExperimental
timerA function is scheduled to be executed regularlyExperimental

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.datasource; http; pubsubRecommendedExperimental

faas.trigger has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.

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
otherIf none of the others applyExperimental
pubsubA function is set to be executed when messages are sent to a messaging systemExperimental
timerA function is scheduled to be executed regularlyExperimental

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.datasource; http; pubsubRecommendedExperimental

faas.trigger has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.

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
otherIf none of the others applyExperimental
pubsubA function is set to be executed when messages are sent to a messaging systemExperimental
timerA function is scheduled to be executed regularlyExperimental

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.datasource; http; pubsubRecommendedExperimental

faas.trigger has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.

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
otherIf none of the others applyExperimental
pubsubA function is set to be executed when messages are sent to a messaging systemExperimental
timerA function is scheduled to be executed regularlyExperimental

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.datasource; http; pubsubRecommendedExperimental

faas.trigger has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.

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
otherIf none of the others applyExperimental
pubsubA function is set to be executed when messages are sent to a messaging systemExperimental
timerA function is scheduled to be executed regularlyExperimental

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.datasource; http; pubsubRecommendedExperimental

faas.trigger has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.

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
otherIf none of the others applyExperimental
pubsubA function is set to be executed when messages are sent to a messaging systemExperimental
timerA function is scheduled to be executed regularlyExperimental

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.datasource; http; pubsubRecommendedExperimental

faas.trigger has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.

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
otherIf none of the others applyExperimental
pubsubA function is set to be executed when messages are sent to a messaging systemExperimental
timerA function is scheduled to be executed regularlyExperimental

References

Metric References

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