Skip to content

Add faas instance entity #2575

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .chloggen/add_instance_entity.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Use this changelog template to create an entry for release notes.
#
# If your change doesn't affect end users you should instead start
# your pull request title with [chore] or use the "Skip Changelog" label.

# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: breaking

# The name of the area of concern in the attributes-registry, (e.g. http, cloud, db)
component: faas

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Rename `faas.instance` to `faas.instance.id` so that an instance entity can exist.

# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
# The values here must be integers.
issues: [2393]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext:
29 changes: 16 additions & 13 deletions docs/registry/attributes/faas.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,28 +15,31 @@ FaaS attributes
| <a id="faas-document-name" href="#faas-document-name">`faas.document.name`</a> | string | 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. | `myFile.txt`; `myTableName` | ![Development](https://img.shields.io/badge/-development-blue) |
| <a id="faas-document-operation" href="#faas-document-operation">`faas.document.operation`</a> | string | Describes the type of the operation that was performed on the data. | `insert`; `edit`; `delete` | ![Development](https://img.shields.io/badge/-development-blue) |
| <a id="faas-document-time" href="#faas-document-time">`faas.document.time`</a> | string | A string containing the time when the data was accessed in the [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format expressed in [UTC](https://www.w3.org/TR/NOTE-datetime). | `2020-01-23T13:47:06Z` | ![Development](https://img.shields.io/badge/-development-blue) |
| <a id="faas-instance" href="#faas-instance">`faas.instance`</a> | string | The 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]2f399eb14537447da05ab2a2e39309de` | ![Development](https://img.shields.io/badge/-development-blue) |
| <a id="faas-instance" href="#faas-instance">`faas.instance`</a> | string | The 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]2f399eb14537447da05ab2a2e39309de` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)<br>Replaced by `faas.instance.id`. |
| <a id="faas-instance-id" href="#faas-instance-id">`faas.instance.id`</a> | string | The execution environment ID as a string, that will be potentially reused for other invocations to the same function/function version. [2] | `2021/06/28/[$LATEST]2f399eb14537447da05ab2a2e39309de` | ![Development](https://img.shields.io/badge/-development-blue) |
| <a id="faas-invocation-id" href="#faas-invocation-id">`faas.invocation_id`</a> | string | The invocation ID of the current function invocation. | `af9d5aa4-a685-4c5f-a22b-444f80b3cc28` | ![Development](https://img.shields.io/badge/-development-blue) |
| <a id="faas-invoked-name" href="#faas-invoked-name">`faas.invoked_name`</a> | string | The name of the invoked function. [2] | `my-function` | ![Development](https://img.shields.io/badge/-development-blue) |
| <a id="faas-invoked-provider" href="#faas-invoked-provider">`faas.invoked_provider`</a> | string | The cloud provider of the invoked function. [3] | `alibaba_cloud`; `aws`; `azure` | ![Development](https://img.shields.io/badge/-development-blue) |
| <a id="faas-invoked-region" href="#faas-invoked-region">`faas.invoked_region`</a> | string | The cloud region of the invoked function. [4] | `eu-central-1` | ![Development](https://img.shields.io/badge/-development-blue) |
| <a id="faas-max-memory" href="#faas-max-memory">`faas.max_memory`</a> | int | The amount of memory available to the serverless function converted to Bytes. [5] | `134217728` | ![Development](https://img.shields.io/badge/-development-blue) |
| <a id="faas-name" href="#faas-name">`faas.name`</a> | string | The name of the single function that this runtime instance executes. [6] | `my-function`; `myazurefunctionapp/some-function-name` | ![Development](https://img.shields.io/badge/-development-blue) |
| <a id="faas-invoked-name" href="#faas-invoked-name">`faas.invoked_name`</a> | string | The name of the invoked function. [3] | `my-function` | ![Development](https://img.shields.io/badge/-development-blue) |
| <a id="faas-invoked-provider" href="#faas-invoked-provider">`faas.invoked_provider`</a> | string | The cloud provider of the invoked function. [4] | `alibaba_cloud`; `aws`; `azure` | ![Development](https://img.shields.io/badge/-development-blue) |
| <a id="faas-invoked-region" href="#faas-invoked-region">`faas.invoked_region`</a> | string | The cloud region of the invoked function. [5] | `eu-central-1` | ![Development](https://img.shields.io/badge/-development-blue) |
| <a id="faas-max-memory" href="#faas-max-memory">`faas.max_memory`</a> | int | The amount of memory available to the serverless function converted to Bytes. [6] | `134217728` | ![Development](https://img.shields.io/badge/-development-blue) |
| <a id="faas-name" href="#faas-name">`faas.name`</a> | string | The name of the single function that this runtime instance executes. [7] | `my-function`; `myazurefunctionapp/some-function-name` | ![Development](https://img.shields.io/badge/-development-blue) |
| <a id="faas-time" href="#faas-time">`faas.time`</a> | string | A string containing the function invocation time in the [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format expressed in [UTC](https://www.w3.org/TR/NOTE-datetime). | `2020-01-23T13:47:06Z` | ![Development](https://img.shields.io/badge/-development-blue) |
| <a id="faas-trigger" href="#faas-trigger">`faas.trigger`</a> | string | Type of the trigger which caused this function invocation. | `datasource`; `http`; `pubsub` | ![Development](https://img.shields.io/badge/-development-blue) |
| <a id="faas-version" href="#faas-version">`faas.version`</a> | string | The immutable version of the function being executed. [7] | `26`; `pinkfroid-00002` | ![Development](https://img.shields.io/badge/-development-blue) |
| <a id="faas-version" href="#faas-version">`faas.version`</a> | string | The immutable version of the function being executed. [8] | `26`; `pinkfroid-00002` | ![Development](https://img.shields.io/badge/-development-blue) |

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

**[2] `faas.invoked_name`:** SHOULD be equal to the `faas.name` resource attribute of the invoked function.
**[2] `faas.instance.id`:** - **AWS Lambda:** Use the (full) log stream name.

**[3] `faas.invoked_provider`:** SHOULD be equal to the `cloud.provider` resource attribute of the invoked function.
**[3] `faas.invoked_name`:** SHOULD be equal to the `faas.name` resource attribute of the invoked function.

**[4] `faas.invoked_region`:** SHOULD be equal to the `cloud.region` resource attribute of the invoked function.
**[4] `faas.invoked_provider`:** SHOULD be equal to the `cloud.provider` resource attribute of the invoked function.

**[5] `faas.max_memory`:** 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).
**[5] `faas.invoked_region`:** SHOULD be equal to the `cloud.region` resource attribute of the invoked function.

**[6] `faas.name`:** This is the name of the function as configured/deployed on the FaaS
**[6] `faas.max_memory`:** 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).

**[7] `faas.name`:** 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.name`](/docs/general/attributes.md#source-code-attributes)
Expand All @@ -53,7 +56,7 @@ definition of function name MUST be used for this attribute
app can host multiple functions that would usually share
a TracerProvider (see also the `cloud.resource_id` attribute).

**[7] `faas.version`:** Depending on the cloud provider and platform, use:
**[8] `faas.version`:** Depending on the cloud provider and platform, use:

- **AWS Lambda:** The [function version](https://docs.aws.amazon.com/lambda/latest/dg/configuration-versions.html)
(an integer represented as a decimal string).
Expand Down
1 change: 1 addition & 0 deletions docs/registry/entities/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ Currently, the following namespaces exist:
| | [device](device.md#device) | ![Development](https://img.shields.io/badge/-development-blue) |
| Faas | | |
| | [faas](faas.md#faas) | ![Development](https://img.shields.io/badge/-development-blue) |
| | [faas.instance](faas.md#faas-instance) | ![Development](https://img.shields.io/badge/-development-blue) |
| GCP | | |
| | [gcp.apphub.application](gcp.md#gcp-apphub-application) | ![Development](https://img.shields.io/badge/-development-blue) |
| | [gcp.apphub.service](gcp.md#gcp-apphub-service) | ![Development](https://img.shields.io/badge/-development-blue) |
Expand Down
32 changes: 24 additions & 8 deletions docs/registry/entities/faas.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@
|---|---|---|---|---|---|
| [`faas.name`](/docs/registry/attributes/faas.md) | string | The name of the single function that this runtime instance executes. [1] | `my-function`; `myazurefunctionapp/some-function-name` | `Required` | ![Development](https://img.shields.io/badge/-development-blue) |
| [`cloud.resource_id`](/docs/registry/attributes/cloud.md) | string | Cloud provider-specific native identifier of the monitored cloud resource (e.g. an [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) on AWS, a [fully qualified resource ID](https://learn.microsoft.com/rest/api/resources/resources/get-by-id) on Azure, a [full resource name](https://google.aip.dev/122#full-resource-names) on GCP) [2] | `arn:aws:lambda:REGION:ACCOUNT_ID:function:my-function`; `//run.googleapis.com/projects/PROJECT_ID/locations/LOCATION_ID/services/SERVICE_ID`; `/subscriptions/<SUBSCRIPTION_GUID>/resourceGroups/<RG>/providers/Microsoft.Web/sites/<FUNCAPP>/functions/<FUNC>` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) |
| [`faas.instance`](/docs/registry/attributes/faas.md) | string | The execution environment ID as a string, that will be potentially reused for other invocations to the same function/function version. [3] | `2021/06/28/[$LATEST]2f399eb14537447da05ab2a2e39309de` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) |
| [`faas.max_memory`](/docs/registry/attributes/faas.md) | int | The amount of memory available to the serverless function converted to Bytes. [4] | `134217728` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) |
| [`faas.version`](/docs/registry/attributes/faas.md) | string | The immutable version of the function being executed. [5] | `26`; `pinkfroid-00002` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) |
| [`faas.version`](/docs/registry/attributes/faas.md) | string | The immutable version of the function being executed. [3] | `26`; `pinkfroid-00002` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) |

**[1] `faas.name`:** This is the name of the function as configured/deployed on the FaaS
platform and is usually different from the name of the callback
Expand Down Expand Up @@ -61,11 +59,7 @@ The following well-known definitions MUST be used if you set this attribute and
This means that a span attribute MUST be used, as an Azure function app can host multiple functions that would usually share
a TracerProvider.

**[3] `faas.instance`:** - **AWS Lambda:** Use the (full) log stream name.

**[4] `faas.max_memory`:** 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).

**[5] `faas.version`:** Depending on the cloud provider and platform, use:
**[3] `faas.version`:** Depending on the cloud provider and platform, use:

- **AWS Lambda:** The [function version](https://docs.aws.amazon.com/lambda/latest/dg/configuration-versions.html)
(an integer represented as a decimal string).
Expand All @@ -75,5 +69,27 @@ The following well-known definitions MUST be used if you set this attribute and
[`K_REVISION` environment variable](https://cloud.google.com/functions/docs/env-var#runtime_environment_variables_set_automatically).
- **Azure Functions:** Not applicable. Do not set this attribute.

## Faas Instance

**Status:** ![Development](https://img.shields.io/badge/-development-blue)

**type:** `faas.instance`

**Description:** A serverless instance.

**Other Attributes:**

> :warning: This entity definition contains attributes without a role.
> Stable Entities MUST NOT have attributes without a defined role.

| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
|---|---|---|---|---|---|
| [`faas.instance.id`](/docs/registry/attributes/faas.md) | string | The execution environment ID as a string, that will be potentially reused for other invocations to the same function/function version. [4] | `2021/06/28/[$LATEST]2f399eb14537447da05ab2a2e39309de` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) |
| [`faas.max_memory`](/docs/registry/attributes/faas.md) | int | The amount of memory available to the serverless function converted to Bytes. [5] | `134217728` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) |

**[4] `faas.instance.id`:** - **AWS Lambda:** Use the (full) log stream name.

**[5] `faas.max_memory`:** 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).


<!-- markdownlint-restore -->
10 changes: 2 additions & 8 deletions docs/resource/faas.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ See also:
|---|---|---|---|---|---|
| [`faas.name`](/docs/registry/attributes/faas.md) | string | The name of the single function that this runtime instance executes. [1] | `my-function`; `myazurefunctionapp/some-function-name` | `Required` | ![Development](https://img.shields.io/badge/-development-blue) |
| [`cloud.resource_id`](/docs/registry/attributes/cloud.md) | string | Cloud provider-specific native identifier of the monitored cloud resource (e.g. an [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) on AWS, a [fully qualified resource ID](https://learn.microsoft.com/rest/api/resources/resources/get-by-id) on Azure, a [full resource name](https://google.aip.dev/122#full-resource-names) on GCP) [2] | `arn:aws:lambda:REGION:ACCOUNT_ID:function:my-function`; `//run.googleapis.com/projects/PROJECT_ID/locations/LOCATION_ID/services/SERVICE_ID`; `/subscriptions/<SUBSCRIPTION_GUID>/resourceGroups/<RG>/providers/Microsoft.Web/sites/<FUNCAPP>/functions/<FUNC>` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) |
| [`faas.instance`](/docs/registry/attributes/faas.md) | string | The execution environment ID as a string, that will be potentially reused for other invocations to the same function/function version. [3] | `2021/06/28/[$LATEST]2f399eb14537447da05ab2a2e39309de` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) |
| [`faas.max_memory`](/docs/registry/attributes/faas.md) | int | The amount of memory available to the serverless function converted to Bytes. [4] | `134217728` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) |
| [`faas.version`](/docs/registry/attributes/faas.md) | string | The immutable version of the function being executed. [5] | `26`; `pinkfroid-00002` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) |
| [`faas.version`](/docs/registry/attributes/faas.md) | string | The immutable version of the function being executed. [3] | `26`; `pinkfroid-00002` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) |

**[1] `faas.name`:** This is the name of the function as configured/deployed on the FaaS
platform and is usually different from the name of the callback
Expand Down Expand Up @@ -68,11 +66,7 @@ The following well-known definitions MUST be used if you set this attribute and
This means that a span attribute MUST be used, as an Azure function app can host multiple functions that would usually share
a TracerProvider.

**[3] `faas.instance`:** - **AWS Lambda:** Use the (full) log stream name.

**[4] `faas.max_memory`:** 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).

**[5] `faas.version`:** Depending on the cloud provider and platform, use:
**[3] `faas.version`:** Depending on the cloud provider and platform, use:

- **AWS Lambda:** The [function version](https://docs.aws.amazon.com/lambda/latest/dg/configuration-versions.html)
(an integer represented as a decimal string).
Expand Down
11 changes: 9 additions & 2 deletions model/faas/entities.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ groups:
- ref: faas.name
requirement_level: required
- ref: faas.version
- ref: faas.instance
- ref: faas.max_memory
- ref: cloud.resource_id
- id: entity.faas.instance
type: entity
stability: development
name: faas.instance
brief: >
A serverless instance.
attributes:
- ref: faas.instance.id
- ref: faas.max_memory
12 changes: 12 additions & 0 deletions model/faas/registry.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,18 @@ groups:
- **Azure Functions:** Not applicable. Do not set this attribute.
examples: ['26', 'pinkfroid-00002']
- id: faas.instance
type: string
stability: development
deprecated:
reason: renamed
renamed_to: faas.instance.id
brief: >
The execution environment ID as a string, that will be potentially reused
for other invocations to the same function/function version.
note: >
- **AWS Lambda:** Use the (full) log stream name.
examples: ['2021/06/28/[$LATEST]2f399eb14537447da05ab2a2e39309de']
- id: faas.instance.id
type: string
stability: development
brief: >
Expand Down
Loading