Observability¶
Understand what your Go Lambda function did, how long it took and where a request failed. Logger, Tracer and Metrics are independent modules that can be adopted together or separately.
Choose a utility¶
| Need | Utility | Start here |
|---|---|---|
| Search structured application logs | Logger | Write JSON logs with Lambda context |
| Follow a request through downstream operations | Tracer | Instrument handlers and calls with OpenTelemetry |
| Monitor application counts, durations and failures | Metrics | Emit CloudWatch Embedded Metric Format |
Start with the complete example in each guide. Keep reusable utility instances outside the handler, and bind invocation-specific context inside it; usage patterns explains their lifetimes.
HTTP observability and AWS X-Ray¶
For routed APIs, use HTTP observability middleware to compose logging, request metrics and route spans. Export maintained tracing through OpenTelemetry and a collector's awsxray exporter. The legacy X-Ray SDK adapter is deprecated and frozen; follow the X-Ray migration guide.
See environment variables for configuration and Getting started for installation.