go-lambda-structured-logging

Standardize structured JSON logging for Go AWS Lambda services.

1|Updated Apr 18, 2026
One-click install
npx skills add https://github.com/primolabs-org/spec-star-go --skill go-lambda-structured-logging
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: go-lambda-structured-logging
Source: https://github.com/primolabs-org/spec-star-go/tree/main/.github/skills/go-lambda-structured-logging
Command: npx skills add https://github.com/primolabs-org/spec-star-go --skill go-lambda-structured-logging

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps Go AWS Lambda services produce structured, machine-parseable logs that are easy to filter, correlate, and debug without noisy ad hoc logging.

Core Features & Use Cases

  • Centralized Logger Setup: Establishes a single JSON-based logger bootstrap with stable service fields and Lambda-friendly output.
  • Request and Message Correlation: Adds request_id, message_id, trigger, operation, and cold_start context at the right architectural boundary.
  • Boundary-Focused Logging: Guides HTTP and SQS adapters to log meaningful start, success, warning, and terminal failure events without duplicate noise.
  • Use Case: Ideal for a hexagonal Go Lambda service that needs consistent logging across API Gateway requests or SQS message batches while keeping sensitive payloads out of logs.

Quick Start

Use the go-lambda-structured-logging skill to review or update the Lambda logging path so it emits JSON logs with stable correlation fields and boundary-level failures.

Frequently Asked Questions about go-lambda-structured-logging

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I standardize structured logging in Go AWS Lambda functions?

Structured logging for Go AWS Lambda services uses centralized slog JSON output with stable service and operation fields, request_id or message_id enrichment, and cold-start tracking to produce correlated, machine-parseable logs.

How do I add request correlation IDs to Go Lambda SQS and HTTP API handlers?

Correlate Go Lambda logs by enriching slog JSON output at adapter boundaries with request_id for API Gateway HTTP API events and message_id for SQS messages, alongside trigger and operation context.

What is the best way to log terminal errors in Go Lambda without exposing secrets?

Secret-safe terminal error handling in Go Lambda logs boundary-level failures at HTTP and SQS adapters, ensuring sensitive payloads stay out of logs while capturing meaningful start, success, warning, and failure events.

Can I use slog for boundary-focused logging in a hexagonal Go Lambda microservice?

Yes, slog works for boundary-focused logging in hexagonal Go Lambda microservices by guiding HTTP and SQS adapters to emit structured JSON logs with stable correlation fields without duplicate noise.

How do I track cold starts in Go AWS Lambda structured logs?

Track cold starts in Go AWS Lambda structured logs by adding a cold_start context field during logger bootstrap, enabling easy filtering of initialization events alongside request_id and operation correlation fields.