Semantic conventions for FaaS metrics

Status: Development

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 executionDevelopment
AttributeTypeDescriptionExamplesRequirement LevelStability
faas.triggerstringType of the trigger which caused this function invocation.datasource; http; pubsubRecommendedDevelopment

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/writeDevelopment
httpTo provide an answer to an inbound HTTP requestDevelopment
otherIf none of the others applyDevelopment
pubsubA function is set to be executed when messages are sent to a messaging systemDevelopment
timerA function is scheduled to be executed regularlyDevelopment

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 startDevelopment
AttributeTypeDescriptionExamplesRequirement LevelStability
faas.triggerstringType of the trigger which caused this function invocation.datasource; http; pubsubRecommendedDevelopment

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/writeDevelopment
httpTo provide an answer to an inbound HTTP requestDevelopment
otherIf none of the others applyDevelopment
pubsubA function is set to be executed when messages are sent to a messaging systemDevelopment
timerA function is scheduled to be executed regularlyDevelopment

Metric: faas.coldstarts

This metric is recommended.

NameInstrument TypeUnit (UCUM)DescriptionStability
faas.coldstartsCounter{coldstart}Number of invocation cold startsDevelopment
AttributeTypeDescriptionExamplesRequirement LevelStability
faas.triggerstringType of the trigger which caused this function invocation.datasource; http; pubsubRecommendedDevelopment

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/writeDevelopment
httpTo provide an answer to an inbound HTTP requestDevelopment
otherIf none of the others applyDevelopment
pubsubA function is set to be executed when messages are sent to a messaging systemDevelopment
timerA function is scheduled to be executed regularlyDevelopment

Metric: faas.errors

This metric is recommended.

NameInstrument TypeUnit (UCUM)DescriptionStability
faas.errorsCounter{error}Number of invocation errorsDevelopment
AttributeTypeDescriptionExamplesRequirement LevelStability
faas.triggerstringType of the trigger which caused this function invocation.datasource; http; pubsubRecommendedDevelopment

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/writeDevelopment
httpTo provide an answer to an inbound HTTP requestDevelopment
otherIf none of the others applyDevelopment
pubsubA function is set to be executed when messages are sent to a messaging systemDevelopment
timerA function is scheduled to be executed regularlyDevelopment

Metric: faas.invocations

This metric is recommended.

NameInstrument TypeUnit (UCUM)DescriptionStability
faas.invocationsCounter{invocation}Number of successful invocationsDevelopment
AttributeTypeDescriptionExamplesRequirement LevelStability
faas.triggerstringType of the trigger which caused this function invocation.datasource; http; pubsubRecommendedDevelopment

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/writeDevelopment
httpTo provide an answer to an inbound HTTP requestDevelopment
otherIf none of the others applyDevelopment
pubsubA function is set to be executed when messages are sent to a messaging systemDevelopment
timerA function is scheduled to be executed regularlyDevelopment

Metric: faas.timeouts

This metric is recommended.

NameInstrument TypeUnit (UCUM)DescriptionStability
faas.timeoutsCounter{timeout}Number of invocation timeoutsDevelopment
AttributeTypeDescriptionExamplesRequirement LevelStability
faas.triggerstringType of the trigger which caused this function invocation.datasource; http; pubsubRecommendedDevelopment

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/writeDevelopment
httpTo provide an answer to an inbound HTTP requestDevelopment
otherIf none of the others applyDevelopment
pubsubA function is set to be executed when messages are sent to a messaging systemDevelopment
timerA function is scheduled to be executed regularlyDevelopment

Metric: faas.mem_usage

This metric is recommended.

NameInstrument TypeUnit (UCUM)DescriptionStability
faas.mem_usageHistogramByDistribution of max memory usage per invocationDevelopment
AttributeTypeDescriptionExamplesRequirement LevelStability
faas.triggerstringType of the trigger which caused this function invocation.datasource; http; pubsubRecommendedDevelopment

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/writeDevelopment
httpTo provide an answer to an inbound HTTP requestDevelopment
otherIf none of the others applyDevelopment
pubsubA function is set to be executed when messages are sent to a messaging systemDevelopment
timerA function is scheduled to be executed regularlyDevelopment

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 invocationDevelopment
AttributeTypeDescriptionExamplesRequirement LevelStability
faas.triggerstringType of the trigger which caused this function invocation.datasource; http; pubsubRecommendedDevelopment

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/writeDevelopment
httpTo provide an answer to an inbound HTTP requestDevelopment
otherIf none of the others applyDevelopment
pubsubA function is set to be executed when messages are sent to a messaging systemDevelopment
timerA function is scheduled to be executed regularlyDevelopment

Metric: faas.net_io

This metric is recommended.

NameInstrument TypeUnit (UCUM)DescriptionStability
faas.net_ioHistogramByDistribution of net I/O usage per invocationDevelopment
AttributeTypeDescriptionExamplesRequirement LevelStability
faas.triggerstringType of the trigger which caused this function invocation.datasource; http; pubsubRecommendedDevelopment

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/writeDevelopment
httpTo provide an answer to an inbound HTTP requestDevelopment
otherIf none of the others applyDevelopment
pubsubA function is set to be executed when messages are sent to a messaging systemDevelopment
timerA function is scheduled to be executed regularlyDevelopment

References

Metric References

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