-
Notifications
You must be signed in to change notification settings - Fork 887
/
faas.yaml
83 lines (78 loc) · 4.47 KB
/
faas.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
groups:
- id: faas_resource
prefix: faas
brief: >
A serverless instance.
attributes:
- id: name
type: string
required: always
brief: >
The name of the single function that this runtime instance executes.
note: |
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`](../../trace/semantic_conventions/span-general.md#source-code-attributes)
span attributes).
For some cloud providers, the above definition is ambiguous. The following
definition of function name MUST be used for this attribute
(and consequently the span name) for the listed cloud providers/products:
* **Azure:** The full name `<FUNCAPP>/<FUNC>`, i.e., function app name
followed by a forward slash followed by the function name (this form
can also be seen in the resource JSON for the function).
This means that a span attribute MUST be used, as an Azure function
app can host multiple functions that would usually share
a TracerProvider (see also the `faas.id` attribute).
examples: ['my-function', 'myazurefunctionapp/some-function-name']
- id: id
type: string
brief: >
The unique ID of the single function that this runtime instance executes.
note: |
On some cloud providers, it may not be possible to determine the full ID at startup,
so consider setting `faas.id` as a span attribute instead.
The exact value to use for `faas.id` depends on the cloud provider:
* **AWS Lambda:** The function [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html).
Take care not to use the "invoked ARN" directly but replace any
[alias suffix](https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html)
with the resolved function version, as the same runtime instance may be invokable with
multiple different aliases.
* **GCP:** The [URI of the resource](https://cloud.google.com/iam/docs/full-resource-names)
* **Azure:** The [Fully Qualified Resource ID](https://docs.microsoft.com/en-us/rest/api/resources/resources/get-by-id) of the invoked function,
*not* the function app, having the form
`/subscriptions/<SUBSCIPTION_GUID>/resourceGroups/<RG>/providers/Microsoft.Web/sites/<FUNCAPP>/functions/<FUNC>`.
This means that a span attribute MUST be used, as an Azure function app can host multiple functions that would usually share
a TracerProvider.
examples: ['arn:aws:lambda:us-west-2:123456789012:function:my-function']
- id: version
type: string
brief: The immutable version of the function being executed.
note: |
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).
* **Google Cloud Run:** The [revision](https://cloud.google.com/run/docs/managing/revisions)
(i.e., the function name plus the revision suffix).
* **Google Cloud Functions:** The value of the
[`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.
examples: ['26', 'pinkfroid-00002']
- id: instance
type: string
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: max_memory
type: int
brief: >
The amount of memory available to the serverless function in MiB.
note: >
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.
examples: 128