Skip to content

Commit

Permalink
Elaborate more the datasource trigger
Browse files Browse the repository at this point in the history
  • Loading branch information
thisthat committed Apr 1, 2020
1 parent 31f22e2 commit b7f9d56
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions specification/data-faas.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.<br /> 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.<br /> 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).
Expand Down

0 comments on commit b7f9d56

Please sign in to comment.