| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
This project demonstrates how to implement distributed tracing and observability in AWS Lambda functions using OpenTelemetry. The sample application processes HTTP requests, writes data to DynamoDB, and sends messages to SQS for asynchronous processing. All components are instrumented with OpenTelemetry for distributed tracing and observability. The application uses AWS CDK to deploy the infrastructure.
┌────────────┐ ┌─────────────┐ ┌─────────────┐
│ │ │ │ │ │
│ API Gateway├────►│ API Lambda ├────►│ DynamoDB │
│ │ │ │ │ │
└────────────┘ └──────┬──────┘ └─────────────┘
│
▼
┌────────────┐ ┌────────────┐
│ │ │ │
│ SQS Queue ├─────►│ SQS Lambda │
│ │ │ │
└────────────┘ └────────────┘
OpenTelemetry distributed tracing
The sample application has these components:
All components are instrumented with OpenTelemetry for distributed tracing and observability.
Clone the repository:
git clone <repository-url> cd otel-lambda-example
Install dependencies:
npm install
Create an API key for your observability backend (this example uses Dash0):
aws ssm put-parameter --name "/otel-lambda-example/api-key" --type "String" --value "your-api-key"
Deploy the stack:
npm run build cdk deploy
The infrastructure is defined in otel-lambda-example-stack.ts using AWS CDK
Two Lambda functions are created:
Both Lambda functions use OpenTelemetry layers for instrumentation:
Telemetry configuration in collector.yaml defines how telemetry data is processed and exported
The application exports telemetry data to the configured backend (Dash0 in this example). You can visualize:
To avoid incurring charges, delete the stack when you're done:
cdk destroy
| Back | FazBrowse Home | New Git URL |