Skip to content

Commit 661a43d

Browse files
authored
Add back refs to cloud.resource_id lost in FaaS renaming. (open-telemetry#3329)
These places were removed when open-telemetry#3188 in its original form removed faas.id without replacement and weren't added back after changing it to introduce cloud.resource_id instead. Editorial change, no CHANGELOG or issue.
1 parent e4eefcc commit 661a43d

File tree

3 files changed

+21
-0
lines changed
  • semantic_conventions/resource
  • specification

3 files changed

+21
-0
lines changed

semantic_conventions/resource/faas.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,4 @@ groups:
6060
On AWS Lambda, the environment variable `AWS_LAMBDA_FUNCTION_MEMORY_SIZE`
6161
provides this information (which must be multiplied by 1,048,576).
6262
examples: 134217728
63+
- ref: cloud.resource_id

specification/resource/semantic_conventions/faas.md

+19
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ See also:
2020
| `faas.version` | string | The immutable version of the function being executed. [2] | `26`; `pinkfroid-00002` | Recommended |
2121
| `faas.instance` | 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 |
2222
| `faas.max_memory` | int | The amount of memory available to the serverless function converted to Bytes. [4] | `134217728` | Recommended |
23+
| [`cloud.resource_id`](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/en-us/rest/api/resources/resources/get-by-id) on Azure, a [full resource name](https://cloud.google.com/apis/design/resource_names#full_resource_name) on GCP) [5] | `arn:aws:lambda:REGION:ACCOUNT_ID:function:my-function`; `//run.googleapis.com/projects/PROJECT_ID/locations/LOCATION_ID/services/SERVICE_ID`; `/subscriptions/<SUBSCIPTION_GUID>/resourceGroups/<RG>/providers/Microsoft.Web/sites/<FUNCAPP>/functions/<FUNC>` | Recommended |
2324

2425
**[1]:** This is the name of the function as configured/deployed on the FaaS
2526
platform and is usually different from the name of the callback
@@ -51,6 +52,24 @@ definition of function name MUST be used for this attribute
5152
**[3]:** * **AWS Lambda:** Use the (full) log stream name.
5253

5354
**[4]:** 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).
55+
56+
**[5]:** On some cloud providers, it may not be possible to determine the full ID at startup,
57+
so it may be necessary to set `cloud.resource_id` as a span attribute instead.
58+
59+
The exact value to use for `cloud.resource_id` depends on the cloud provider.
60+
The following well-known definitions MUST be used if you set this attribute and they apply:
61+
62+
* **AWS Lambda:** The function [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html).
63+
Take care not to use the "invoked ARN" directly but replace any
64+
[alias suffix](https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html)
65+
with the resolved function version, as the same runtime instance may be invokable with
66+
multiple different aliases.
67+
* **GCP:** The [URI of the resource](https://cloud.google.com/iam/docs/full-resource-names)
68+
* **Azure:** The [Fully Qualified Resource ID](https://docs.microsoft.com/en-us/rest/api/resources/resources/get-by-id) of the invoked function,
69+
*not* the function app, having the form
70+
`/subscriptions/<SUBSCIPTION_GUID>/resourceGroups/<RG>/providers/Microsoft.Web/sites/<FUNCAPP>/functions/<FUNC>`.
71+
This means that a span attribute MUST be used, as an Azure function app can host multiple functions that would usually share
72+
a TracerProvider.
5473
<!-- endsemconv -->
5574

5675
Note: The resource attribute `faas.instance` differs from the span attribute `faas.invocation_id`. For more information see the [Semantic conventions for FaaS spans](../../trace/semantic_conventions/faas.md#difference-between-invocation-and-instance).

specification/trace/semantic_conventions/faas.md

+1
Original file line numberDiff line numberDiff line change
@@ -254,3 +254,4 @@ This example shows the FaaS attributes for a (non-FaaS) process hosted on Google
254254
| Resource | `faas.name` | n/a | `"my-lambda-function"` |
255255
| Resource | `faas.version` | n/a | `"semver:2.0.0"` |
256256
| Resource | `faas.instance` | n/a | `"my-lambda-function:instance-0001"` |
257+
| Resource | `cloud.resource_id` | n/a | `"arn:aws:lambda:us-west-2:123456789012:function:my-lambda-function"` |

0 commit comments

Comments
 (0)