-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverless.yml
32 lines (27 loc) · 992 Bytes
/
serverless.yml
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
service: serverless-lambda-layer-otel-example
frameworkVersion: '3'
provider:
name: aws
runtime: nodejs18.x
region: us-east-2 # region must match for your Lambda Layer ARN below
tracing: # x-ray is required
lambda: true
functions:
api:
handler: index.handler
timeout: 10
layers:
# how to get the managed lambda arn? https://aws-otel.github.io/docs/getting-started/lambda/lambda-js
- arn:aws:lambda:us-east-2:901920570463:layer:aws-otel-nodejs-amd64-ver-1-12-0:1
environment:
# let otel Lambda Layer where the config file is located at
OPENTELEMETRY_COLLECTOR_CONFIG_FILE: "/var/task/collector.yaml"
AWS_LAMBDA_EXEC_WRAPPER: "/opt/otel-handler"
OTEL_SERVICE_NAME: "serverless-lambda-layer-otel-example"
OTEL_RESOURCE_ATTRIBUTES: "deployment.environment=staging"
# optional otel collector Lambda Layer config:
# OTEL_LOG_LEVEL: "DEBUG"
events:
- httpApi:
path: /
method: get