From b7f9d5646aa2c669db39dbc1b373d7c650fe32ab Mon Sep 17 00:00:00 2001 From: Giovanni Liva Date: Thu, 23 Jan 2020 17:27:21 +0100 Subject: [PATCH] Elaborate more the datasource trigger --- specification/data-faas.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/specification/data-faas.md b/specification/data-faas.md index ce8f9ddfe20..a7848b5109d 100644 --- a/specification/data-faas.md +++ b/specification/data-faas.md @@ -49,8 +49,17 @@ Therefore, the span attribute `faas.execution` differs from the resource attribu This section describes how to handle the span creation and additional attributes based on the value of the attribute `faas.trigger`. ## Datasource -The function is meant to answer to a single event generated by a datasource, e.g. DynamoDB, Cloud Storage, Cosmos DB. -In this case, a `faas` span MUST be created with the additional attributes defined in the [Semantic Convention for databases](data-database.md). + +A datasource function is triggered as a response to some data source operation such as a database or filesystem read/write. +For `faas` spans with trigger `datasource`, it is recommended to set the following attributes. + +| Attribute name | Notes and examples | Required? | +|---|---|--| +| `faas.document.collection` | The name of the source on which the operation was perfomed. For example, in Cloud Storage or S3 corresponds to the bucket name, and in Cosmos DB to the database name. | Yes | +| `faas.document.operation` | Describes the type of the operation that was performed on the data.
It SHOULD be one of the following strings: "insert", "edit", "delete". | Yes | +| `faas.document.time` | A string containing the time when the data was accessed in the [ISO 8601] format expressed in [UTC]. E.g. `"2020-01-23T13:47:06Z"` | Yes | +| `faas.document.name` | The 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. | No | + ## HTTP The function responsibility is to provide an answer to an inbound HTTP request. The `faas` span MUST follow the recomandations described in the [HTTP Server semantic conventions](data-http.md#http-server-semantic-conventions).