Faas

Function as a Service Attributes

FaaS attributes

AttributeTypeDescriptionExamplesStability
faas.coldstartbooleanA boolean that is true if the serverless function is executed for the first time (aka cold-start).Experimental
faas.cronstringA string containing the schedule period as Cron Expression.0/5 * * * ? *Experimental
faas.document.collectionstringThe name of the source on which the triggering operation was performed. For example, in Cloud Storage or S3 corresponds to the bucket name, and in Cosmos DB to the database name.myBucketName; myDbNameExperimental
faas.document.namestringThe document name/table subjected to the operation. For example, in Cloud Storage or S3 is the name of the file, and in Cosmos DB the table name.myFile.txt; myTableNameExperimental
faas.document.operationstringDescribes the type of the operation that was performed on the data.insert; edit; deleteExperimental
faas.document.timestringA string containing the time when the data was accessed in the ISO 8601 format expressed in UTC.2020-01-23T13:47:06ZExperimental
faas.instancestringThe execution environment ID as a string, that will be potentially reused for other invocations to the same function/function version. [1]2021/06/28/[$LATEST]2f399eb14537447da05ab2a2e39309deExperimental
faas.invocation_idstringThe invocation ID of the current function invocation.af9d5aa4-a685-4c5f-a22b-444f80b3cc28Experimental
faas.invoked_namestringThe name of the invoked function. [2]my-functionExperimental
faas.invoked_providerstringThe cloud provider of the invoked function. [3]alibaba_cloud; aws; azureExperimental
faas.invoked_regionstringThe cloud region of the invoked function. [4]eu-central-1Experimental
faas.max_memoryintThe amount of memory available to the serverless function converted to Bytes. [5]134217728Experimental
faas.namestringThe name of the single function that this runtime instance executes. [6]my-function; myazurefunctionapp/some-function-nameExperimental
faas.timestringA string containing the function invocation time in the ISO 8601 format expressed in UTC.2020-01-23T13:47:06ZExperimental
faas.triggerstringType of the trigger which caused this function invocation.datasource; http; pubsubExperimental
faas.versionstringThe immutable version of the function being executed. [7]26; pinkfroid-00002Experimental

[1]: * AWS Lambda: Use the (full) log stream name.

[2]: SHOULD be equal to the faas.name resource attribute of the invoked function.

[3]: SHOULD be equal to the cloud.provider resource attribute of the invoked function.

[4]: SHOULD be equal to the cloud.region resource attribute of the invoked function.

[5]: It’s recommended to set this attribute since e.g. too little memory can easily stop a Java AWS Lambda function from working correctly. On AWS Lambda, the environment variable AWS_LAMBDA_FUNCTION_MEMORY_SIZE provides this information (which must be multiplied by 1,048,576).

[6]: This is the name of the function as configured/deployed on the FaaS platform and is usually different from the name of the callback function (which may be stored in the code.namespace/code.function span attributes).

For some cloud providers, the above definition is ambiguous. The following definition of function name MUST be used for this attribute (and consequently the span name) for the listed cloud providers/products:

  • Azure: The full name <FUNCAPP>/<FUNC>, i.e., function app name followed by a forward slash followed by the function name (this form can also be seen in the resource JSON for the function). This means that a span attribute MUST be used, as an Azure function app can host multiple functions that would usually share a TracerProvider (see also the cloud.resource_id attribute).

[7]: Depending on the cloud provider and platform, use:

  • AWS Lambda: The function version (an integer represented as a decimal string).
  • Google Cloud Run (Services): The revision (i.e., the function name plus the revision suffix).
  • Google Cloud Functions: The value of the K_REVISION environment variable.
  • Azure Functions: Not applicable. Do not set this attribute.

faas.document.operation 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
deleteWhen an object is deleted.Experimental
editWhen an object is modified.Experimental
insertWhen a new object is created.Experimental

faas.invoked_provider 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
alibaba_cloudAlibaba CloudExperimental
awsAmazon Web ServicesExperimental
azureMicrosoft AzureExperimental
gcpGoogle Cloud PlatformExperimental
tencent_cloudTencent CloudExperimental

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