Skip to content

Commit e70969f

Browse files
authored
Add new example for Lambda layer + otel + CodeSee (#9)
* init commit for a working otel + lambda layer * update * remove unneeded role for xray
1 parent f833906 commit e70969f

File tree

7 files changed

+8568
-0
lines changed

7 files changed

+8568
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@ This repo contains various example on how to integrate with CodeSee
77
`sst-cdk-lambda-layer-example` - Show you example Serverless Stack + CDK to integrate with CodeSee Lambda Layer
88

99
`serverless-al2-example` - Show you example Serverless + Golang + Amazon Linux 2 + CodeSee Lambda Layer
10+
11+
`serverless-lambda-otel-example` - Show you example Serverless + Lambda + Open Telemetry integration
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# serverless-lambda-otel-example
2+
3+
Example Serverless + Lambda + Open Telemetry integration
4+
5+
## Install packages
6+
7+
```
8+
npm i
9+
```
10+
11+
## Deploy Lambda
12+
13+
```
14+
sls deploy
15+
```
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
receivers:
2+
otlp:
3+
protocols:
4+
grpc:
5+
endpoint: localhost:4317
6+
http:
7+
endpoint: localhost:4318
8+
9+
exporters:
10+
otlp/codesee:
11+
endpoint: "in-otel.codesee.io:443"
12+
headers:
13+
Authorization: "Bearer XXX"
14+
15+
service:
16+
pipelines:
17+
traces:
18+
receivers: [otlp]
19+
exporters: [otlp/codesee]
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
module.exports.handler = async (event) => {
2+
3+
return {
4+
statusCode: 200,
5+
body: JSON.stringify(
6+
{
7+
message: "hello from serverless-lambda-otel-example lambda",
8+
input: event,
9+
},
10+
null,
11+
2
12+
),
13+
};
14+
};

0 commit comments

Comments
 (0)