Skip to content

Commit 99d2fca

Browse files
authored
Rename faas.execution to faas.invocation_id and change units for faas.max_memory (open-telemetry#3209)
1 parent 92d8a98 commit 99d2fca

File tree

8 files changed

+98
-27
lines changed

8 files changed

+98
-27
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ release.
2424

2525
- Move X-Ray Env Variable propagation to span link instead of parent for AWS Lambda.
2626
([#3166](https://github.com/open-telemetry/opentelemetry-specification/pull/3166))
27+
- BREAKING: Rename faas.execution to faas.invocation_id
28+
([#3209](https://github.com/open-telemetry/opentelemetry-specification/pull/3209))
29+
- BREAKING: Change faas.max_memory units to Bytes instead of MB
30+
([#3209](https://github.com/open-telemetry/opentelemetry-specification/pull/3209))
2731

2832
### Compatibility
2933

schemas/1.19.0

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
file_format: 1.1.0
2+
schema_url: https://opentelemetry.io/schemas/1.19.0
3+
versions:
4+
1.19.0:
5+
spans:
6+
changes:
7+
# https://github.com/open-telemetry/opentelemetry-specification/pull/3209
8+
- rename_attributes:
9+
attribute_map:
10+
faas.execution: faas.invocation_id
11+
1.18.0:
12+
1.17.0:
13+
spans:
14+
changes:
15+
# https://github.com/open-telemetry/opentelemetry-specification/pull/2957
16+
- rename_attributes:
17+
attribute_map:
18+
messaging.consumer_id: messaging.consumer.id
19+
messaging.protocol: net.app.protocol.name
20+
messaging.protocol_version: net.app.protocol.version
21+
messaging.destination: messaging.destination.name
22+
messaging.temp_destination: messaging.destination.temporary
23+
messaging.destination_kind: messaging.destination.kind
24+
messaging.message_id: messaging.message.id
25+
messaging.conversation_id: messaging.message.conversation_id
26+
messaging.message_payload_size_bytes: messaging.message.payload_size_bytes
27+
messaging.message_payload_compressed_size_bytes: messaging.message.payload_compressed_size_bytes
28+
messaging.rabbitmq.routing_key: messaging.rabbitmq.destination.routing_key
29+
messaging.kafka.message_key: messaging.kafka.message.key
30+
messaging.kafka.partition: messaging.kafka.destination.partition
31+
messaging.kafka.tombstone: messaging.kafka.message.tombstone
32+
messaging.rocketmq.message_type: messaging.rocketmq.message.type
33+
messaging.rocketmq.message_tag: messaging.rocketmq.message.tag
34+
messaging.rocketmq.message_keys: messaging.rocketmq.message.keys
35+
messaging.kafka.consumer_group: messaging.kafka.consumer.group
36+
1.16.0:
37+
1.15.0:
38+
spans:
39+
changes:
40+
# https://github.com/open-telemetry/opentelemetry-specification/pull/2743
41+
- rename_attributes:
42+
attribute_map:
43+
http.retry_count: http.resend_count
44+
1.14.0:
45+
1.13.0:
46+
spans:
47+
changes:
48+
# https://github.com/open-telemetry/opentelemetry-specification/pull/2614
49+
- rename_attributes:
50+
attribute_map:
51+
net.peer.ip: net.sock.peer.addr
52+
net.host.ip: net.sock.host.addr
53+
1.12.0:
54+
1.11.0:
55+
1.10.0:
56+
1.9.0:
57+
1.8.0:
58+
spans:
59+
changes:
60+
- rename_attributes:
61+
attribute_map:
62+
db.cassandra.keyspace: db.name
63+
db.hbase.namespace: db.name
64+
1.7.0:
65+
1.6.1:
66+
1.5.0:
67+
1.4.0:

semantic_conventions/resource/faas.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,10 @@ groups:
7575
- id: max_memory
7676
type: int
7777
brief: >
78-
The amount of memory available to the serverless function in MiB.
78+
The amount of memory available to the serverless function converted to Bytes.
7979
note: >
8080
It's recommended to set this attribute since e.g. too little memory can easily
8181
stop a Java AWS Lambda function from working correctly.
8282
On AWS Lambda, the environment variable `AWS_LAMBDA_FUNCTION_MEMORY_SIZE`
83-
provides this information.
84-
examples: 128
83+
provides this information (which must be multiplied by 1,048,576).
84+
examples: 134217728

semantic_conventions/trace/faas.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ groups:
88
serverless functions or Function as a Service (FaaS)) with spans.
99
attributes:
1010
- id: trigger
11-
brief: 'Type of the trigger which caused this function execution.'
11+
brief: 'Type of the trigger which caused this function invocation.'
1212
note: |
1313
For the server/consumer span on the incoming side,
1414
`faas.trigger` MUST be set.
@@ -37,9 +37,9 @@ groups:
3737
- id: other
3838
value: 'other'
3939
brief: 'If none of the others apply'
40-
- id: execution
40+
- id: invocation_id
4141
type: string
42-
brief: 'The execution ID of the current function execution.'
42+
brief: 'The invocation ID of the current function invocation.'
4343
examples: 'af9d5aa4-a685-4c5f-a22b-444f80b3cc28'
4444

4545
- id: faas_span.datasource

specification/metrics/semantic_conventions/faas-metrics.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Below is a table of FaaS invocation metric instruments.
4242
| `faas.init_duration` | Histogram | milliseconds | `ms` | Measures the duration of the function's initialization, such as a cold start |
4343
| `faas.coldstarts` | Counter | default unit | `{coldstarts}` | Number of invocation cold starts. |
4444
| `faas.errors` | Counter | default unit | `{errors}` | Number of invocation errors. |
45-
| `faas.executions` | Counter | default unit | `{executions}` | Number of successful invocations. |
45+
| `faas.invocations` | Counter | default unit | `{invocations}` | Number of successful invocations. |
4646
| `faas.timeouts` | Counter | default unit | `{timeouts}` | Number of invocation timeouts. |
4747

4848
Optionally, when applicable:
@@ -65,9 +65,9 @@ Below is a table of the attributes to be included on FaaS metric events.
6565
| `faas.invoked_region` | Required | Cloud provider region of invoked function. Corresponds to resource `cloud.region`. Example: `us-east-1` |
6666

6767
More details on these attributes, the function name and the difference compared to the faas.invoked_name can be found at the related [FaaS tracing specification](../../trace/semantic_conventions/faas.md).
68-
For incoming FaaS executions, the function for which metrics are reported is already described by its [FaaS resource attributes](../../resource/semantic_conventions/faas.md).
69-
Outgoing FaaS executions are identified using the `faas.invoked_*` attributes above.
70-
`faas.trigger` SHOULD be included in all metric events while `faas.invoked_*` attributes apply on outgoing FaaS execution events only.
68+
For incoming FaaS invocations, the function for which metrics are reported is already described by its [FaaS resource attributes](../../resource/semantic_conventions/faas.md).
69+
Outgoing FaaS invocations are identified using the `faas.invoked_*` attributes above.
70+
`faas.trigger` SHOULD be included in all metric events while `faas.invoked_*` attributes apply on outgoing FaaS invocation events only.
7171

7272
## References
7373

specification/resource/semantic_conventions/faas.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ See also:
2020
| `faas.id` | string | The unique ID of the single function that this runtime instance executes. [2] | `arn:aws:lambda:us-west-2:123456789012:function:my-function` | Recommended |
2121
| `faas.version` | string | The immutable version of the function being executed. [3] | `26`; `pinkfroid-00002` | Recommended |
2222
| `faas.instance` | 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 |
23-
| `faas.max_memory` | int | The amount of memory available to the serverless function in MiB. [5] | `128` | Recommended |
23+
| `faas.max_memory` | int | The amount of memory available to the serverless function converted to Bytes. [5] | `134217728` | Recommended |
2424

2525
**[1]:** This is the name of the function as configured/deployed on the FaaS
2626
platform and is usually different from the name of the callback
@@ -68,10 +68,10 @@ The exact value to use for `faas.id` depends on the cloud provider:
6868

6969
**[4]:** * **AWS Lambda:** Use the (full) log stream name.
7070

71-
**[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.
71+
**[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).
7272
<!-- endsemconv -->
7373

74-
Note: The resource attribute `faas.instance` differs from the span attribute `faas.execution`. For more information see the [Semantic conventions for FaaS spans](../../trace/semantic_conventions/faas.md#difference-between-execution-and-instance).
74+
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).
7575

7676
## Using span attributes instead of resource attributes
7777

specification/trace/semantic_conventions/faas.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ See also the [additional instructions for instrumenting AWS Lambda](instrumentat
1313

1414
- [General Attributes](#general-attributes)
1515
* [Function Name](#function-name)
16-
* [Difference between execution and instance](#difference-between-execution-and-instance)
16+
* [Difference between invocation and instance](#difference-between-invocation-and-instance)
1717
- [Incoming Invocations](#incoming-invocations)
1818
* [Incoming FaaS Span attributes](#incoming-faas-span-attributes)
1919
* [Resource attributes as incoming FaaS span attributes](#resource-attributes-as-incoming-faas-span-attributes)
@@ -37,8 +37,8 @@ If Spans following this convention are produced, a Resource of type `faas` MUST
3737
<!-- semconv faas_span -->
3838
| Attribute | Type | Description | Examples | Requirement Level |
3939
|---|---|---|---|---|
40-
| `faas.trigger` | string | Type of the trigger which caused this function execution. [1] | `datasource` | Recommended |
41-
| `faas.execution` | string | The execution ID of the current function execution. | `af9d5aa4-a685-4c5f-a22b-444f80b3cc28` | Recommended |
40+
| `faas.trigger` | string | Type of the trigger which caused this function invocation. [1] | `datasource` | Recommended |
41+
| `faas.invocation_id` | string | The invocation ID of the current function invocation. | `af9d5aa4-a685-4c5f-a22b-444f80b3cc28` | Recommended |
4242

4343
**[1]:** For the server/consumer span on the incoming side,
4444
`faas.trigger` MUST be set.
@@ -73,15 +73,15 @@ purpose. It is also highly likely that Span name will contain the function name
7373
weaker "SHOULD" requirement). Consumers that needs such guarantee can use
7474
`faas.name` attribute as the source.
7575

76-
### Difference between execution and instance
76+
### Difference between invocation and instance
7777

7878
For performance reasons (e.g. [AWS lambda], or [Azure functions]), FaaS providers allocate an execution environment for a single instance of a function that is used to serve multiple requests.
79-
Developers exploit this fact to solve the **cold start** issue, caching expensive resource computations between different function executions.
79+
Developers exploit this fact to solve the **cold start** issue, caching expensive resource computations between different function invocations.
8080
Furthermore, FaaS providers encourage this behavior, e.g. [Google functions].
81-
The `faas.instance` resource attribute MAY be set to help correlate function executions that belong to the same execution environment.
82-
The span attribute `faas.execution` differs from the [resource attribute][FaaS resource attributes] `faas.instance` in the following:
81+
The `faas.instance` resource attribute MAY be set to help correlate function invocations that belong to the same execution environment.
82+
The span attribute `faas.invocation_id` differs from the [resource attribute][FaaS resource attributes] `faas.instance` in the following:
8383

84-
- `faas.execution` refers to the current request ID handled by the function;
84+
- `faas.invocation_id` refers to the ID of the current invocation of the function;
8585
- `faas.instance` refers to the execution environment ID of the function.
8686

8787
[AWS lambda]: https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html
@@ -100,7 +100,7 @@ For incoming FaaS spans, the span kind MUST be `Server`.
100100
| Attribute | Type | Description | Examples | Requirement Level |
101101
|---|---|---|---|---|
102102
| `faas.coldstart` | boolean | A boolean that is true if the serverless function is executed for the first time (aka cold-start). | | Recommended |
103-
| `faas.trigger` | string | Type of the trigger which caused this function execution. [1] | `datasource` | Required |
103+
| `faas.trigger` | string | Type of the trigger which caused this function invocation. [1] | `datasource` | Required |
104104

105105
**[1]:** For the server/consumer span on the incoming side,
106106
`faas.trigger` MUST be set.
@@ -197,9 +197,9 @@ The function responsibility is to provide an answer to an inbound HTTP request.
197197
### PubSub
198198

199199
A function is set to be executed when messages are sent to a messaging system.
200-
In this case, multiple messages could be batch and forwarded at once to the same function execution.
200+
In this case, multiple messages could be batch and forwarded at once to the same function invocation.
201201
Therefore, a different root span of type `faas` MUST be created for each message processed by the function, following the [Messaging systems semantic conventions](messaging.md).
202-
This way, it is possible to correlate each individual message with its execution sender.
202+
This way, it is possible to correlate each individual message with its invocation sender.
203203

204204
### Timer
205205

@@ -230,7 +230,7 @@ This example shows the FaaS attributes for a (non-FaaS) process hosted on Google
230230
| Span | `faas.invoked_provider` | `"aws"` | n/a |
231231
| Span | `faas.invoked_region` | `"eu-central-1"` | n/a |
232232
| Span | `faas.trigger` | n/a | `"http"` |
233-
| Span | `faas.execution` | n/a | `"af9d5aa4-a685-4c5f-a22b-444f80b3cc28"` |
233+
| Span | `faas.invocation_id` | n/a | `"af9d5aa4-a685-4c5f-a22b-444f80b3cc28"` |
234234
| Span | `faas.coldstart` | n/a | `true` |
235235
| Resource | `faas.name` | n/a | `"my-lambda-function"` |
236236
| Resource | `faas.id` | n/a | `"arn:aws:lambda:us-west-2:123456789012:function:my-lambda-function"` |

specification/trace/semantic_conventions/instrumentation/aws-lambda.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Lambda `Context`.
3636

3737
The following attributes SHOULD be set:
3838

39-
- [`faas.execution`][faas] - The value of the AWS Request ID, which is always available through an accessor on the Lambda `Context`.
39+
- [`faas.invocation_id`][faas] - The value of the AWS Request ID, which is always available through an accessor on the Lambda `Context`.
4040
- [`faas.id`][faasres] - The value of the invocation ARN
4141
for the function, which is always available through an accessor on the
4242
Lambda `Context`, modified as follows: Discard all parts beyond the seventh (when split on `:`;
@@ -169,7 +169,7 @@ Function F: | Span Function |
169169
| Parent | | Span Client |
170170
| SpanKind | `CLIENT` | `SERVER` |
171171
| Status | `Ok` | `Ok` |
172-
| `faas.execution` | | `79104EXAMPLEB723` |
172+
| `faas.invocation_id` | | `79104EXAMPLEB723` |
173173
| `faas.id` | | `arn:aws:lambda:us-west-2:123456789012:function:my-function` |
174174
| `faas.trigger` | | `http` |
175175
| `cloud.account.id` | | `12345678912` |

0 commit comments

Comments
 (0)