Feat/chapter 09 observability#24
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds comprehensive observability capabilities to the Rust link shortener application using OpenTelemetry. It implements distributed tracing across Lambda functions and messaging systems (SQS, Kinesis) by integrating CloudEvents with embedded trace context for propagating traces across asynchronous boundaries.
Key changes:
- Introduced OpenTelemetry initialization with trace, metric, and log providers configured for AWS Lambda and CloudWatch
- Wrapped event payloads in CloudEvents format with traceparent extension for distributed tracing
- Added instrumentation to all Lambda handlers and repository methods with semantic conventions for messaging operations
Reviewed changes
Copilot reviewed 40 out of 42 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
| chapter-09/template.yaml | Added ROTEL environment variables and Lambda layer for OpenTelemetry, CloudWatch permissions for XRay and logs |
| chapter-09/shared/src/observability/*.rs | New observability module with OTel initialization, trace context extraction, and span linking utilities |
| chapter-09/shared/src/adapters.rs | Added tracing instrumentation to DynamoDB repository methods |
| chapter-09/shared/src/url_info.rs | Added tracing instrumentation to URL info fetching |
| chapter-09/shared/Cargo.toml | Added OpenTelemetry, tracing, and CloudEvents dependencies |
| chapter-09/lambdas/*/src/main.rs | Replaced default tracing with OTel initialization and added flush calls after handler execution |
| chapter-09/lambdas//src/_handler.rs | Added tracing instrumentation with messaging semantic conventions |
| chapter-09/lambdas/*/src/event_publisher.rs | Wrapped events in CloudEvents with traceparent for trace propagation |
| chapter-09/examples/sqs-send-traced-message/* | New example demonstrating CloudEvent creation and SQS publishing with tracing |
| chapter-09/examples/sqs-receive-traced-message/* | New example demonstrating CloudEvent consumption from SQS with span linking |
| chapter-09/examples/otel-simple/* | New basic OpenTelemetry example with instrumented functions |
| chapter-09/examples/lambda-process-sqs/* | Updated example to process CloudEvents with distributed tracing |
| chapter-09/docker-compose.yml | Added Jaeger all-in-one container for local tracing |
| chapter-09/README.md | Added CloudWatch query examples for traces and logs |
| chapter-09/Cargo.toml | Updated workspace members to include new examples |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Update reqwest dependency from 0.12 to 0.13 across all chapters. The explicit rustls-tls and http2 features are no longer needed as reqwest 0.13 uses rustls-platform-verifier by default.
chore(deps): update reqwest to 0.13
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.