You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/docs/getting-started/lambda.mdx
+31-14Lines changed: 31 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,19 +32,20 @@ The AWS Distro for OpenTelemetry now supports AWS Distro for OpenTelemetry Lambd
32
32
See the documentation on the [OpenTelemetry Lambda repository](https://github.com/open-telemetry/opentelemetry-lambda/).
33
33
34
34
## Custom configuration for the ADOT Collector on Lambda
35
-
The ADOT Lambda layers combines both OpenTelemetry and the ADOT Collector.
35
+
The ADOT Lambda layers combines both OpenTelemetry SDK and the ADOT Collector components.
36
36
The configuration of the ADOT Collector follows the OpenTelemetry standard.
37
37
By default, the ADOT Lambda layer uses [config.yaml](https://github.com/aws-observability/aws-otel-lambda/blob/main/adot/collector/config.yaml),
38
38
which exports telemetry data to AWS X-Ray.
39
39
40
40
Please find the list of available components supported for custom configuration [here](https://github.com/aws-observability/aws-otel-lambda/blob/main/README.md#adot-lambda-layer-available-components). To enable debugging, you can use the configuration file to set log level to debug. See the example below.
41
41
42
-
To customize the collector configuration, add a configuration yaml file to your function code.
43
-
Once the file has been deployed with a Lambda function, create an environment variable on your Lambda
44
-
function `OPENTELEMETRY_COLLECTOR_CONFIG_FILE` and set it to `/var/task/*<path/<to>/<filename>*`.
42
+
The ADOT Lambda Layer support the following types of confmap providers: file, env, yaml, http, https and s3. To customize the ADOT collector configuration using different Confmap providers, Please refer to [Confmap providers](/docs/components/confmap-providers#confmap-providers-supported-by-the-adot-collector) section.
43
+
Once your collector configuration is set through a `confmap` providers.
44
+
Create an environment variable on your Lambda function `OPENTELEMETRY_COLLECTOR_CONFIG_FILE` and set the path of configuration w.r.t to the confmap provider as its value. for e.g, if you are using a file configmap provider, set its value to `/var/task/*<path/<to>/<filename>*`.
45
45
This will tell the extension where to find the collector configuration.
46
46
47
-
Here is a sample configuration file, collector.yaml in the root directory:
47
+
Here is a sample configuration file of collector.yaml in the root directory:
48
+
48
49
```yaml
49
50
#collector.yaml in the root directory
50
51
#Set an environemnt variable 'OPENTELEMETRY_COLLECTOR_CONFIG_FILE' to '/var/task/collector.yaml'
@@ -53,32 +54,35 @@ receivers:
53
54
otlp:
54
55
protocols:
55
56
grpc:
57
+
endpoint: "localhost:4317"
56
58
http:
59
+
endpoint: "localhost:4318"
57
60
58
61
exporters:
59
62
logging:
60
-
loglevel: debug
61
63
awsxray:
62
64
63
-
#enables output for traces to xray
64
65
service:
65
66
pipelines:
66
67
traces:
67
68
receivers: [otlp]
68
-
exporters: [logging, awsxray]
69
+
exporters: [awsxray]
70
+
metrics:
71
+
receivers: [otlp]
72
+
exporters: [logging]
73
+
telemetry:
74
+
metrics:
75
+
address: localhost:8888
76
+
69
77
```
70
78
You can set this via the Lambda console, or via the AWS CLI.
71
-
```
72
-
aws lambda update-function-configuration --function-name Function --environment Variables={OPENTELEMETRY_COLLECTOR_CONFIG_FILE=/var/task/collector.yaml}
73
-
```
74
79
75
-
As an alternative to uploading your collector.yaml file directly with your code, you can zip your file and upload your zip as a separate Lambda layer.
76
-
You can set this via the Lambda console, or via the AWS CLI.
77
80
```
78
-
aws lambda update-function-configuration --function-name Function --environment Variables={OPENTELEMETRY_COLLECTOR_CONFIG_FILE=/opt/collector.yaml}
81
+
aws lambda update-function-configuration --function-name Function --environment Variables={OPENTELEMETRY_COLLECTOR_CONFIG_FILE=/var/task/collector.yaml}
79
82
```
80
83
81
84
You can configure environment variables via **CloudFormation** template as well:
Loading configuration from S3 will require that the IAM role attached to your function includes read access to the relevant bucket.
91
108
92
109
For more information about ADOT Collector configuration, such as adding ca/cert/key files, see the Github [README.md](https://github.com/aws-observability/aws-otel-lambda/blob/main/README.md).
| ap-northeast-1<br/>ap-northeast-2<br/>ap-south-1<br/>ap-southeast-1<br/>ap-southeast-2<br/>ca-central-1<br/>eu-central-1<br/>eu-north-1<br/>eu-west-1<br/>eu-west-2<br/>eu-west-3<br/>sa-east-1<br/>us-east-1<br/>us-east-2<br/>us-west-1<br/>us-west-2 | arn:aws:lambda:<region\>:901920570463:layer:aws-otel-nodejs-<architecture\>-ver-1-9-1:2|Contains [OpenTelemetry for JavaScript v1.9.1](https://github.com/open-telemetry/opentelemetry-js/releases/tag/v1.9.1) with [Lambda instrumentation v0.35.0](https://github.com/open-telemetry/opentelemetry-js-contrib/releases/tag/instrumentation-aws-lambda-v0.35.0) <br/><br/> Contains the [ADOT Collector for Lambda v0.27.0](https://github.com/aws-observability/aws-otel-lambda/releases/tag/adot%2Fcollector%2Flambdacomponents%2Fv0.27.0)|
32
+
| ap-northeast-1<br/>ap-northeast-2<br/>ap-south-1<br/>ap-southeast-1<br/>ap-southeast-2<br/>ca-central-1<br/>eu-central-1<br/>eu-north-1<br/>eu-west-1<br/>eu-west-2<br/>eu-west-3<br/>sa-east-1<br/>us-east-1<br/>us-east-2<br/>us-west-1<br/>us-west-2 | arn:aws:lambda:<region\>:901920570463:layer:aws-otel-nodejs-<architecture\>-ver-1-12-0:1|Contains [OpenTelemetry for JavaScript v1.12.0](https://github.com/open-telemetry/opentelemetry-js/releases/tag/v1.12.0) with [Lambda instrumentation v0.35.0](https://github.com/open-telemetry/opentelemetry-js-contrib/releases/tag/instrumentation-aws-lambda-v0.35.0) <br/><br/> Contains ADOT Collector v0.28.0 |
33
33
34
34
### Enable auto-instrumentation for your Lambda function
35
35
To enable the AWS Distro for OpenTelemetry in your Lambda function, you need to add and configure the layer, and then enable tracing.
0 commit comments