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)Description
faas.invoke_durationHistogramsMeasures the duration of the function’s logic execution
AttributeTypeDescriptionExamplesRequirement Level
faas.triggerstringType of the trigger which caused this function invocation.datasourceRecommended

faas.trigger MUST be one of the following:

ValueDescription
datasourceA response to some data source operation such as a database or filesystem read/write
httpTo provide an answer to an inbound HTTP request
pubsubA function is set to be executed when messages are sent to a messaging system
timerA function is scheduled to be executed regularly
otherIf none of the others apply

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)Description
faas.init_durationHistogramsMeasures the duration of the function’s initialization, such as a cold start
AttributeTypeDescriptionExamplesRequirement Level
faas.triggerstringType of the trigger which caused this function invocation.datasourceRecommended

faas.trigger MUST be one of the following:

ValueDescription
datasourceA response to some data source operation such as a database or filesystem read/write
httpTo provide an answer to an inbound HTTP request
pubsubA function is set to be executed when messages are sent to a messaging system
timerA function is scheduled to be executed regularly
otherIf none of the others apply

Metric: faas.coldstarts

This metric is recommended.

NameInstrument TypeUnit (UCUM)Description
faas.coldstartsCounter{coldstart}Number of invocation cold starts
AttributeTypeDescriptionExamplesRequirement Level
faas.triggerstringType of the trigger which caused this function invocation.datasourceRecommended

faas.trigger MUST be one of the following:

ValueDescription
datasourceA response to some data source operation such as a database or filesystem read/write
httpTo provide an answer to an inbound HTTP request
pubsubA function is set to be executed when messages are sent to a messaging system
timerA function is scheduled to be executed regularly
otherIf none of the others apply

Metric: faas.errors

This metric is recommended.

NameInstrument TypeUnit (UCUM)Description
faas.errorsCounter{error}Number of invocation errors
AttributeTypeDescriptionExamplesRequirement Level
faas.triggerstringType of the trigger which caused this function invocation.datasourceRecommended

faas.trigger MUST be one of the following:

ValueDescription
datasourceA response to some data source operation such as a database or filesystem read/write
httpTo provide an answer to an inbound HTTP request
pubsubA function is set to be executed when messages are sent to a messaging system
timerA function is scheduled to be executed regularly
otherIf none of the others apply

Metric: faas.invocations

This metric is recommended.

NameInstrument TypeUnit (UCUM)Description
faas.invocationsCounter{invocation}Number of successful invocations
AttributeTypeDescriptionExamplesRequirement Level
faas.triggerstringType of the trigger which caused this function invocation.datasourceRecommended

faas.trigger MUST be one of the following:

ValueDescription
datasourceA response to some data source operation such as a database or filesystem read/write
httpTo provide an answer to an inbound HTTP request
pubsubA function is set to be executed when messages are sent to a messaging system
timerA function is scheduled to be executed regularly
otherIf none of the others apply

Metric: faas.timeouts

This metric is recommended.

NameInstrument TypeUnit (UCUM)Description
faas.timeoutsCounter{timeout}Number of invocation timeouts
AttributeTypeDescriptionExamplesRequirement Level
faas.triggerstringType of the trigger which caused this function invocation.datasourceRecommended

faas.trigger MUST be one of the following:

ValueDescription
datasourceA response to some data source operation such as a database or filesystem read/write
httpTo provide an answer to an inbound HTTP request
pubsubA function is set to be executed when messages are sent to a messaging system
timerA function is scheduled to be executed regularly
otherIf none of the others apply

Metric: faas.mem_usage

This metric is recommended.

NameInstrument TypeUnit (UCUM)Description
faas.mem_usageHistogramByDistribution of max memory usage per invocation
AttributeTypeDescriptionExamplesRequirement Level
faas.triggerstringType of the trigger which caused this function invocation.datasourceRecommended

faas.trigger MUST be one of the following:

ValueDescription
datasourceA response to some data source operation such as a database or filesystem read/write
httpTo provide an answer to an inbound HTTP request
pubsubA function is set to be executed when messages are sent to a messaging system
timerA function is scheduled to be executed regularly
otherIf none of the others apply

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)Description
faas.cpu_usageHistogramsDistribution of CPU usage per invocation
AttributeTypeDescriptionExamplesRequirement Level
faas.triggerstringType of the trigger which caused this function invocation.datasourceRecommended

faas.trigger MUST be one of the following:

ValueDescription
datasourceA response to some data source operation such as a database or filesystem read/write
httpTo provide an answer to an inbound HTTP request
pubsubA function is set to be executed when messages are sent to a messaging system
timerA function is scheduled to be executed regularly
otherIf none of the others apply

Metric: faas.net_io

This metric is recommended.

NameInstrument TypeUnit (UCUM)Description
faas.net_ioHistogramByDistribution of net I/O usage per invocation
AttributeTypeDescriptionExamplesRequirement Level
faas.triggerstringType of the trigger which caused this function invocation.datasourceRecommended

faas.trigger MUST be one of the following:

ValueDescription
datasourceA response to some data source operation such as a database or filesystem read/write
httpTo provide an answer to an inbound HTTP request
pubsubA function is set to be executed when messages are sent to a messaging system
timerA function is scheduled to be executed regularly
otherIf none of the others apply

References

Metric References

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