What is Powertools for AWS Lambda (Go)¶
Powertools for Go Lambda is a collection of utilities for building native Go functions on AWS Lambda. Add structured logging, OpenTelemetry tracing, metrics, and event handling to your functions with independently versioned Go modules.
This is an independent community implementation based on Powertools for AWS Lambda (TypeScript) v2.35.0. It is a development subset with documented compatibility boundaries; initial public release tags are pending.
Getting started¶
Follow the first Lambda guide to compose Logger and Tracer around a typed handler, configure a collector, and build an executable for provided.al2023.
Use Go 1.26 or newer, target arm64 or x86_64, and keep CGO disabled. Start from the local workspace until module releases are available. The module guide explains dependencies, imports, and independent versioning.
Before choosing a utility, read usage patterns for object and wrapper lifetimes, and environment variables for configuration. Every main utility guide shows a complete example, expected output and its TypeScript mapping.
Features¶
Choose the utilities your application needs. Each feature has its own Go module; adding one utility does not install the entire toolkit.
| Utility | What you can do |
|---|---|
| Tracer | Trace handlers, operations, HTTP requests, and AWS SDK calls using OpenTelemetry. Export to AWS X-Ray through a collector. |
| Logger | Write structured JSON logs with Lambda context, correlation IDs, configurable levels, and optional buffering. |
| Metrics | Emit application metrics using CloudWatch Embedded Metric Format. |
| Event handlers | Route HTTP requests, stream responses, and handle AppSync Events, AppSync GraphQL, and Bedrock Agent functions. |
| Parameters | Retrieve and cache configuration from SSM, Secrets Manager, DynamoDB, and AppConfig. |
| Idempotency | Protect operations from duplicate execution with DynamoDB or optional Redis/Valkey persistence. |
| Batch processing | Process SQS, Kinesis, and DynamoDB Streams batches with partial failure handling. |
| JMESPath | Query JSON documents and unwrap supported event envelopes. |
| Parser | Parse event payloads into typed values and compose validation with your handler. |
| Validation | Validate inputs and responses against JSON Schema. |
| Data Masking | Erase or transform selected fields, with optional regex and KMS providers. |
| Kafka | Decode Kafka events with JSON, Avro, or Protobuf payloads. |
| Signer | Sign HTTP requests with AWS Signature Version 4. |
| Commons and Metadata | Reuse runtime primitives and retrieve Lambda execution-environment metadata. |
The manifest contains 31 modules, including 28 public modules. The legacy X-Ray SDK adapter is included in that count but is deprecated and frozen. Follow the OpenTelemetry migration guide for maintained X-Ray support.
Examples¶
The quickstart includes a complete Go handler directly from the maintained source. For other use cases, browse the examples directory or start with one of these guides:
- HTTP routing and middleware, including response streaming.
- Batch processing with typed event parsing.
- AppSync Events, AppSync GraphQL, and Bedrock Agents.
Project status¶
Use the TypeScript feature comparison, project progress and roadmap to distinguish implemented behavior from remaining compatibility and release work. Local acceptance records describe the scope of previous verification; they do not establish exhaustive parity or cloud acceptance.
Original contributions are licensed under MIT. Third-party content retains its original attribution. This project is not an official AWS distribution.