@caddis/cli 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +29 -16
- package/bundles/antigravity-plugin-extras/plugin.json +5 -0
- package/bundles/antigravity-plugin-extras/skills/_registry.md +154 -0
- package/bundles/antigravity-plugin-extras/skills/agent-md-refactor/SKILL.md +356 -0
- package/bundles/antigravity-plugin-extras/skills/agent-orchestration/SKILL.md +517 -0
- package/bundles/antigravity-plugin-extras/skills/algorithmic-art/SKILL.md +293 -0
- package/bundles/antigravity-plugin-extras/skills/anchor-review/SKILL.md +135 -0
- package/bundles/antigravity-plugin-extras/skills/api-client-patterns/SKILL.md +367 -0
- package/bundles/antigravity-plugin-extras/skills/architecture-design/SKILL.md +244 -0
- package/bundles/antigravity-plugin-extras/skills/architecture-diagram/SKILL.md +156 -0
- package/bundles/antigravity-plugin-extras/skills/architecture-document/SKILL.md +321 -0
- package/bundles/antigravity-plugin-extras/skills/artifacts-builder/LICENSE.txt +202 -0
- package/bundles/antigravity-plugin-extras/skills/artifacts-builder/SKILL.md +74 -0
- package/bundles/antigravity-plugin-extras/skills/artifacts-builder/scripts/bundle-artifact.sh +54 -0
- package/bundles/antigravity-plugin-extras/skills/artifacts-builder/scripts/init-artifact.sh +322 -0
- package/bundles/antigravity-plugin-extras/skills/artifacts-builder/scripts/shadcn-components.tar.gz +0 -0
- package/bundles/antigravity-plugin-extras/skills/ascii-art/SKILL.md +144 -0
- package/bundles/antigravity-plugin-extras/skills/asking-questions/SKILL.md +81 -0
- package/bundles/antigravity-plugin-extras/skills/aws-agentic-ai/SKILL.md +118 -0
- package/bundles/antigravity-plugin-extras/skills/aws-agentic-ai/cross-service/credential-management.md +450 -0
- package/bundles/antigravity-plugin-extras/skills/aws-agentic-ai/services/browser/README.md +363 -0
- package/bundles/antigravity-plugin-extras/skills/aws-agentic-ai/services/code-interpreter/README.md +232 -0
- package/bundles/antigravity-plugin-extras/skills/aws-agentic-ai/services/gateway/README.md +100 -0
- package/bundles/antigravity-plugin-extras/skills/aws-agentic-ai/services/gateway/deploy-template.sh +117 -0
- package/bundles/antigravity-plugin-extras/skills/aws-agentic-ai/services/gateway/deployment-strategies.md +416 -0
- package/bundles/antigravity-plugin-extras/skills/aws-agentic-ai/services/gateway/troubleshooting-guide.md +384 -0
- package/bundles/antigravity-plugin-extras/skills/aws-agentic-ai/services/gateway/validate-deployment.sh +186 -0
- package/bundles/antigravity-plugin-extras/skills/aws-agentic-ai/services/identity/README.md +186 -0
- package/bundles/antigravity-plugin-extras/skills/aws-agentic-ai/services/memory/README.md +253 -0
- package/bundles/antigravity-plugin-extras/skills/aws-agentic-ai/services/observability/README.md +517 -0
- package/bundles/antigravity-plugin-extras/skills/aws-agentic-ai/services/runtime/README.md +215 -0
- package/bundles/antigravity-plugin-extras/skills/aws-cdk-development/SKILL.md +279 -0
- package/bundles/antigravity-plugin-extras/skills/aws-cdk-development/references/cdk-patterns.md +431 -0
- package/bundles/antigravity-plugin-extras/skills/aws-cdk-development/scripts/validate-stack.sh +240 -0
- package/bundles/antigravity-plugin-extras/skills/aws-cost-operations/SKILL.md +318 -0
- package/bundles/antigravity-plugin-extras/skills/aws-cost-operations/references/cloudwatch-alarms.md +567 -0
- package/bundles/antigravity-plugin-extras/skills/aws-cost-operations/references/operations-patterns.md +394 -0
- package/bundles/antigravity-plugin-extras/skills/aws-serverless-eda/SKILL.md +758 -0
- package/bundles/antigravity-plugin-extras/skills/aws-serverless-eda/references/deployment-best-practices.md +830 -0
- package/bundles/antigravity-plugin-extras/skills/aws-serverless-eda/references/eda-patterns.md +1002 -0
- package/bundles/antigravity-plugin-extras/skills/aws-serverless-eda/references/observability-best-practices.md +770 -0
- package/bundles/antigravity-plugin-extras/skills/aws-serverless-eda/references/performance-optimization.md +671 -0
- package/bundles/antigravity-plugin-extras/skills/aws-serverless-eda/references/security-best-practices.md +625 -0
- package/bundles/antigravity-plugin-extras/skills/aws-serverless-eda/references/serverless-patterns.md +838 -0
- package/bundles/antigravity-plugin-extras/skills/backend-to-frontend-handoff/SKILL.md +139 -0
- package/bundles/antigravity-plugin-extras/skills/banner-design/SKILL.md +188 -0
- package/bundles/antigravity-plugin-extras/skills/brand-design/SKILL.md +298 -0
- package/bundles/antigravity-plugin-extras/skills/brand-guidelines/LICENSE.txt +202 -0
- package/bundles/antigravity-plugin-extras/skills/brand-guidelines/SKILL.md +118 -0
- package/bundles/antigravity-plugin-extras/skills/brand-voice/SKILL.md +93 -0
- package/bundles/antigravity-plugin-extras/skills/building-ai-agent-on-cloudflare/SKILL.md +392 -0
- package/bundles/antigravity-plugin-extras/skills/building-ai-agent-on-cloudflare/references/agent-patterns.md +461 -0
- package/bundles/antigravity-plugin-extras/skills/building-ai-agent-on-cloudflare/references/examples.md +188 -0
- package/bundles/antigravity-plugin-extras/skills/building-ai-agent-on-cloudflare/references/state-patterns.md +360 -0
- package/bundles/antigravity-plugin-extras/skills/building-ai-agent-on-cloudflare/references/troubleshooting.md +362 -0
- package/bundles/antigravity-plugin-extras/skills/building-mcp-server-on-cloudflare/SKILL.md +266 -0
- package/bundles/antigravity-plugin-extras/skills/building-mcp-server-on-cloudflare/references/examples.md +115 -0
- package/bundles/antigravity-plugin-extras/skills/building-mcp-server-on-cloudflare/references/oauth-setup.md +338 -0
- package/bundles/antigravity-plugin-extras/skills/building-mcp-server-on-cloudflare/references/troubleshooting.md +317 -0
- package/bundles/antigravity-plugin-extras/skills/caching-patterns/SKILL.md +385 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/LICENSE.txt +202 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/SKILL.md +91 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/ArsenalSC-OFL.txt +93 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/ArsenalSC-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/BigShoulders-Bold.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/BigShoulders-OFL.txt +93 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/BigShoulders-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Boldonse-OFL.txt +93 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Boldonse-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/BricolageGrotesque-Bold.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/BricolageGrotesque-OFL.txt +93 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/BricolageGrotesque-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/CrimsonPro-Bold.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/CrimsonPro-Italic.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/CrimsonPro-OFL.txt +93 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/CrimsonPro-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/DMMono-OFL.txt +93 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/DMMono-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/EricaOne-OFL.txt +94 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/EricaOne-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/GeistMono-Bold.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/GeistMono-OFL.txt +93 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/GeistMono-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Gloock-OFL.txt +93 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Gloock-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/IBMPlexMono-Bold.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/IBMPlexMono-OFL.txt +93 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/IBMPlexMono-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/IBMPlexSerif-Bold.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/IBMPlexSerif-BoldItalic.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/IBMPlexSerif-Italic.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/IBMPlexSerif-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/InstrumentSans-Bold.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/InstrumentSans-BoldItalic.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/InstrumentSans-Italic.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/InstrumentSans-OFL.txt +93 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/InstrumentSans-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/InstrumentSerif-Italic.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/InstrumentSerif-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Italiana-OFL.txt +93 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Italiana-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/JetBrainsMono-Bold.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/JetBrainsMono-OFL.txt +93 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/JetBrainsMono-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Jura-Light.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Jura-Medium.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Jura-OFL.txt +93 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/LibreBaskerville-OFL.txt +93 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/LibreBaskerville-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Lora-Bold.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Lora-BoldItalic.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Lora-Italic.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Lora-OFL.txt +93 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Lora-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/NationalPark-Bold.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/NationalPark-OFL.txt +93 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/NationalPark-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/NothingYouCouldDo-OFL.txt +93 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/NothingYouCouldDo-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Outfit-Bold.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Outfit-OFL.txt +93 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Outfit-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/PixelifySans-Medium.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/PixelifySans-OFL.txt +93 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/PoiretOne-OFL.txt +93 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/PoiretOne-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/RedHatMono-Bold.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/RedHatMono-OFL.txt +93 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/RedHatMono-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Silkscreen-OFL.txt +93 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Silkscreen-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/SmoochSans-Medium.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/SmoochSans-OFL.txt +93 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Tektur-Medium.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Tektur-OFL.txt +93 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Tektur-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/WorkSans-Bold.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/WorkSans-BoldItalic.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/WorkSans-Italic.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/WorkSans-OFL.txt +93 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/WorkSans-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/YoungSerif-OFL.txt +93 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/YoungSerif-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/changelog-generator/SKILL.md +105 -0
- package/bundles/antigravity-plugin-extras/skills/code-explainer/SKILL.md +91 -0
- package/bundles/antigravity-plugin-extras/skills/competitive-ads-extractor/SKILL.md +294 -0
- package/bundles/antigravity-plugin-extras/skills/component-testing/SKILL.md +310 -0
- package/bundles/antigravity-plugin-extras/skills/content-research-writer/SKILL.md +539 -0
- package/bundles/antigravity-plugin-extras/skills/cross-review/SKILL.md +51 -0
- package/bundles/antigravity-plugin-extras/skills/data-analysis/SKILL.md +111 -0
- package/bundles/antigravity-plugin-extras/skills/data-contract-pipeline/README.md +248 -0
- package/bundles/antigravity-plugin-extras/skills/data-contract-pipeline/SKILL.md +203 -0
- package/bundles/antigravity-plugin-extras/skills/data-contract-pipeline/assets/adapter.py.template +44 -0
- package/bundles/antigravity-plugin-extras/skills/data-contract-pipeline/assets/api-router.py.template +43 -0
- package/bundles/antigravity-plugin-extras/skills/data-contract-pipeline/assets/contract-test.py.template +384 -0
- package/bundles/antigravity-plugin-extras/skills/data-contract-pipeline/assets/display-dto.py.template +39 -0
- package/bundles/antigravity-plugin-extras/skills/data-contract-pipeline/assets/frontend-service.ts.template +46 -0
- package/bundles/antigravity-plugin-extras/skills/data-contract-pipeline/assets/frontend-types.ts.template +38 -0
- package/bundles/antigravity-plugin-extras/skills/data-contract-pipeline/assets/ingestion-model.py.template +42 -0
- package/bundles/antigravity-plugin-extras/skills/data-contract-pipeline/assets/mapping-doc.md.template +46 -0
- package/bundles/antigravity-plugin-extras/skills/data-contract-pipeline/assets/normalizer.py.template +48 -0
- package/bundles/antigravity-plugin-extras/skills/data-contract-pipeline/assets/prompts/extract_requirements.md +36 -0
- package/bundles/antigravity-plugin-extras/skills/data-contract-pipeline/assets/prompts/extract_ui_demand.md +35 -0
- package/bundles/antigravity-plugin-extras/skills/data-contract-pipeline/assets/prompts/reconcile_mapping.md +66 -0
- package/bundles/antigravity-plugin-extras/skills/data-contract-pipeline/assets/query-catalog.md.template +62 -0
- package/bundles/antigravity-plugin-extras/skills/data-contract-pipeline/references/consumer-driven-contracts.md +131 -0
- package/bundles/antigravity-plugin-extras/skills/data-contract-pipeline/references/drift-check-catalog.md +305 -0
- package/bundles/antigravity-plugin-extras/skills/data-contract-pipeline/references/layer-responsibilities.md +333 -0
- package/bundles/antigravity-plugin-extras/skills/data-contract-pipeline/scripts/discover_connections.py +170 -0
- package/bundles/antigravity-plugin-extras/skills/data-contract-pipeline/scripts/discover_sources.py +161 -0
- package/bundles/antigravity-plugin-extras/skills/data-contract-pipeline/scripts/drift_check.py +171 -0
- package/bundles/antigravity-plugin-extras/skills/data-contract-pipeline/scripts/extract_schema.py +1363 -0
- package/bundles/antigravity-plugin-extras/skills/data-contract-pipeline/scripts/generate_gap_report.py +81 -0
- package/bundles/antigravity-plugin-extras/skills/data-contract-pipeline/scripts/generate_mapping_doc.py +294 -0
- package/bundles/antigravity-plugin-extras/skills/data-contract-pipeline/scripts/ts_dto_compare.py +214 -0
- package/bundles/antigravity-plugin-extras/skills/data-contract-pipeline/scripts/validate_lineage.py +51 -0
- package/bundles/antigravity-plugin-extras/skills/data-loader/SKILL.md +753 -0
- package/bundles/antigravity-plugin-extras/skills/data-validation/SKILL.md +220 -0
- package/bundles/antigravity-plugin-extras/skills/db-testing/SKILL.md +117 -0
- package/bundles/antigravity-plugin-extras/skills/deploy-local/SKILL.md +259 -0
- package/bundles/antigravity-plugin-extras/skills/design-md/SKILL.md +167 -0
- package/bundles/antigravity-plugin-extras/skills/design-system-tokens/SKILL.md +240 -0
- package/bundles/antigravity-plugin-extras/skills/design-system-tokens/references/DESIGN-SYSTEM-TEMPLATE.md +577 -0
- package/bundles/antigravity-plugin-extras/skills/developer-growth-analysis/SKILL.md +323 -0
- package/bundles/antigravity-plugin-extras/skills/doc-coauthoring/SKILL.md +378 -0
- package/bundles/antigravity-plugin-extras/skills/documentation-analyzer/SKILL.md +78 -0
- package/bundles/antigravity-plugin-extras/skills/domain-name-brainstormer/SKILL.md +213 -0
- package/bundles/antigravity-plugin-extras/skills/enterprise-dashboard-aesthetic-system/SKILL.md +120 -0
- package/bundles/antigravity-plugin-extras/skills/excalidraw/SKILL.md +193 -0
- package/bundles/antigravity-plugin-extras/skills/excalidraw/references/element-types.md +497 -0
- package/bundles/antigravity-plugin-extras/skills/excalidraw/references/excalidraw-schema.md +356 -0
- package/bundles/antigravity-plugin-extras/skills/excalidraw/references/reliable-diagrams.md +115 -0
- package/bundles/antigravity-plugin-extras/skills/excalidraw/scripts/README.md +60 -0
- package/bundles/antigravity-plugin-extras/skills/excalidraw/scripts/add-arrow.py +354 -0
- package/bundles/antigravity-plugin-extras/skills/excalidraw/scripts/add-icon-to-diagram.py +412 -0
- package/bundles/antigravity-plugin-extras/skills/excalidraw/scripts/split-excalidraw-library.py +183 -0
- package/bundles/antigravity-plugin-extras/skills/excalidraw/templates/business-flow-swimlane-template.excalidraw +334 -0
- package/bundles/antigravity-plugin-extras/skills/excalidraw/templates/class-diagram-template.excalidraw +558 -0
- package/bundles/antigravity-plugin-extras/skills/excalidraw/templates/data-flow-diagram-template.excalidraw +279 -0
- package/bundles/antigravity-plugin-extras/skills/excalidraw/templates/er-diagram-template.excalidraw +662 -0
- package/bundles/antigravity-plugin-extras/skills/excalidraw/templates/flowchart-template.excalidraw +179 -0
- package/bundles/antigravity-plugin-extras/skills/excalidraw/templates/mindmap-template.excalidraw +244 -0
- package/bundles/antigravity-plugin-extras/skills/excalidraw/templates/relationship-template.excalidraw +145 -0
- package/bundles/antigravity-plugin-extras/skills/excalidraw/templates/reliable-flowchart.excalidraw +1 -0
- package/bundles/antigravity-plugin-extras/skills/excalidraw/templates/sequence-diagram-template.excalidraw +509 -0
- package/bundles/antigravity-plugin-extras/skills/file-organizer/SKILL.md +434 -0
- package/bundles/antigravity-plugin-extras/skills/game-changing-features/README.md +221 -0
- package/bundles/antigravity-plugin-extras/skills/game-changing-features/SKILL.md +265 -0
- package/bundles/antigravity-plugin-extras/skills/github-issues/SKILL.md +359 -0
- package/bundles/antigravity-plugin-extras/skills/github-issues/references/templates.md +90 -0
- package/bundles/antigravity-plugin-extras/skills/golden-nuggets/SKILL.md +192 -0
- package/bundles/antigravity-plugin-extras/skills/humanizer/SKILL.md +194 -0
- package/bundles/antigravity-plugin-extras/skills/image-enhancer/SKILL.md +100 -0
- package/bundles/antigravity-plugin-extras/skills/intent-writer/SKILL.md +201 -0
- package/bundles/antigravity-plugin-extras/skills/internal-comms/LICENSE.txt +202 -0
- package/bundles/antigravity-plugin-extras/skills/internal-comms/SKILL.md +124 -0
- package/bundles/antigravity-plugin-extras/skills/internal-comms/examples/3p-updates.md +47 -0
- package/bundles/antigravity-plugin-extras/skills/internal-comms/examples/company-newsletter.md +65 -0
- package/bundles/antigravity-plugin-extras/skills/internal-comms/examples/faq-answers.md +30 -0
- package/bundles/antigravity-plugin-extras/skills/internal-comms/examples/general-comms.md +16 -0
- package/bundles/antigravity-plugin-extras/skills/invoice-organizer/SKILL.md +447 -0
- package/bundles/antigravity-plugin-extras/skills/jira-issues/SKILL.md +182 -0
- package/bundles/antigravity-plugin-extras/skills/job-application/SKILL.md +188 -0
- package/bundles/antigravity-plugin-extras/skills/lead-research-assistant/SKILL.md +200 -0
- package/bundles/antigravity-plugin-extras/skills/llm-application-dev/SKILL.md +217 -0
- package/bundles/antigravity-plugin-extras/skills/mcp-builder/LICENSE.txt +202 -0
- package/bundles/antigravity-plugin-extras/skills/mcp-builder/SKILL.md +100 -0
- package/bundles/antigravity-plugin-extras/skills/mcp-builder/references/evaluation.md +602 -0
- package/bundles/antigravity-plugin-extras/skills/mcp-builder/references/mcp_best_practices.md +915 -0
- package/bundles/antigravity-plugin-extras/skills/mcp-builder/references/node_mcp_server.md +916 -0
- package/bundles/antigravity-plugin-extras/skills/mcp-builder/references/python_mcp_server.md +752 -0
- package/bundles/antigravity-plugin-extras/skills/mcp-builder/scripts/connections.py +151 -0
- package/bundles/antigravity-plugin-extras/skills/mcp-builder/scripts/evaluation.py +373 -0
- package/bundles/antigravity-plugin-extras/skills/mcp-builder/scripts/example_evaluation.xml +22 -0
- package/bundles/antigravity-plugin-extras/skills/mcp-builder/scripts/requirements.txt +2 -0
- package/bundles/antigravity-plugin-extras/skills/meeting-insights-analyzer/SKILL.md +328 -0
- package/bundles/antigravity-plugin-extras/skills/monorepo/SKILL.md +267 -0
- package/bundles/antigravity-plugin-extras/skills/naming-analyzer/SKILL.md +376 -0
- package/bundles/antigravity-plugin-extras/skills/nextjs-app-router/SKILL.md +271 -0
- package/bundles/antigravity-plugin-extras/skills/notebooklm/AUTHENTICATION.md +154 -0
- package/bundles/antigravity-plugin-extras/skills/notebooklm/SKILL.md +270 -0
- package/bundles/antigravity-plugin-extras/skills/notebooklm/references/api_reference.md +309 -0
- package/bundles/antigravity-plugin-extras/skills/notebooklm/references/troubleshooting.md +376 -0
- package/bundles/antigravity-plugin-extras/skills/notebooklm/references/usage_patterns.md +338 -0
- package/bundles/antigravity-plugin-extras/skills/notebooklm/scripts/__init__.py +81 -0
- package/bundles/antigravity-plugin-extras/skills/notebooklm/scripts/ask_question.py +256 -0
- package/bundles/antigravity-plugin-extras/skills/notebooklm/scripts/auth_manager.py +358 -0
- package/bundles/antigravity-plugin-extras/skills/notebooklm/scripts/browser_session.py +255 -0
- package/bundles/antigravity-plugin-extras/skills/notebooklm/scripts/browser_utils.py +107 -0
- package/bundles/antigravity-plugin-extras/skills/notebooklm/scripts/cleanup_manager.py +302 -0
- package/bundles/antigravity-plugin-extras/skills/notebooklm/scripts/config.py +44 -0
- package/bundles/antigravity-plugin-extras/skills/notebooklm/scripts/notebook_manager.py +410 -0
- package/bundles/antigravity-plugin-extras/skills/notebooklm/scripts/run.py +102 -0
- package/bundles/antigravity-plugin-extras/skills/notebooklm/scripts/setup_environment.py +204 -0
- package/bundles/antigravity-plugin-extras/skills/observability/SKILL.md +371 -0
- package/bundles/antigravity-plugin-extras/skills/onboard-project/SKILL.md +192 -0
- package/bundles/antigravity-plugin-extras/skills/performance-testing/SKILL.md +226 -0
- package/bundles/antigravity-plugin-extras/skills/pipeline-state/SKILL.md +208 -0
- package/bundles/antigravity-plugin-extras/skills/plantuml/SKILL.md +228 -0
- package/bundles/antigravity-plugin-extras/skills/popular-web-designs/SKILL.md +142 -0
- package/bundles/antigravity-plugin-extras/skills/popular-web-designs/templates/linear.app.md +196 -0
- package/bundles/antigravity-plugin-extras/skills/popular-web-designs/templates/stripe.md +214 -0
- package/bundles/antigravity-plugin-extras/skills/popular-web-designs/templates/vercel.md +218 -0
- package/bundles/antigravity-plugin-extras/skills/prd-to-code/SKILL.md +127 -0
- package/bundles/antigravity-plugin-extras/skills/raffle-winner-picker/SKILL.md +159 -0
- package/bundles/antigravity-plugin-extras/skills/react-useeffect/README.md +320 -0
- package/bundles/antigravity-plugin-extras/skills/react-useeffect/SKILL.md +53 -0
- package/bundles/antigravity-plugin-extras/skills/react-useeffect/alternatives.md +258 -0
- package/bundles/antigravity-plugin-extras/skills/react-useeffect/anti-patterns.md +290 -0
- package/bundles/antigravity-plugin-extras/skills/receiving-code-review/SKILL.md +213 -0
- package/bundles/antigravity-plugin-extras/skills/relay/SKILL.md +246 -0
- package/bundles/antigravity-plugin-extras/skills/requesting-code-review/SKILL.md +105 -0
- package/bundles/antigravity-plugin-extras/skills/requesting-code-review/code-reviewer.md +146 -0
- package/bundles/antigravity-plugin-extras/skills/responsive-mobile-native/SKILL.md +350 -0
- package/bundles/antigravity-plugin-extras/skills/responsive-mobile-native/references/pwa-checklist.md +226 -0
- package/bundles/antigravity-plugin-extras/skills/responsive-mobile-native/references/touch-and-interaction.md +265 -0
- package/bundles/antigravity-plugin-extras/skills/responsive-mobile-native/references/transformation-catalogue.md +326 -0
- package/bundles/antigravity-plugin-extras/skills/schema-migration/SKILL.md +275 -0
- package/bundles/antigravity-plugin-extras/skills/setup-project-ai/SKILL.md +120 -0
- package/bundles/antigravity-plugin-extras/skills/shadcn-radix/SKILL.md +330 -0
- package/bundles/antigravity-plugin-extras/skills/sketch/SKILL.md +104 -0
- package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/LICENSE.txt +202 -0
- package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/SKILL.md +646 -0
- package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/core/color_palettes.py +302 -0
- package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/core/easing.py +230 -0
- package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/core/frame_composer.py +469 -0
- package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/core/gif_builder.py +246 -0
- package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/core/typography.py +357 -0
- package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/core/validators.py +264 -0
- package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/core/visual_effects.py +494 -0
- package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/requirements.txt +4 -0
- package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/templates/bounce.py +106 -0
- package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/templates/explode.py +331 -0
- package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/templates/fade.py +329 -0
- package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/templates/flip.py +291 -0
- package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/templates/kaleidoscope.py +211 -0
- package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/templates/morph.py +329 -0
- package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/templates/move.py +293 -0
- package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/templates/pulse.py +268 -0
- package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/templates/shake.py +127 -0
- package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/templates/slide.py +291 -0
- package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/templates/spin.py +269 -0
- package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/templates/wiggle.py +300 -0
- package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/templates/zoom.py +312 -0
- package/bundles/antigravity-plugin-extras/skills/slides/SKILL.md +38 -0
- package/bundles/antigravity-plugin-extras/skills/state-tracking/SKILL.md +131 -0
- package/bundles/antigravity-plugin-extras/skills/streamlit-dev/SKILL.md +268 -0
- package/bundles/antigravity-plugin-extras/skills/svg-create/SKILL.md +251 -0
- package/bundles/antigravity-plugin-extras/skills/theme-factory/LICENSE.txt +202 -0
- package/bundles/antigravity-plugin-extras/skills/theme-factory/SKILL.md +59 -0
- package/bundles/antigravity-plugin-extras/skills/theme-factory/theme-showcase.pdf +0 -0
- package/bundles/antigravity-plugin-extras/skills/theme-factory/themes/arctic-frost.md +19 -0
- package/bundles/antigravity-plugin-extras/skills/theme-factory/themes/botanical-garden.md +19 -0
- package/bundles/antigravity-plugin-extras/skills/theme-factory/themes/desert-rose.md +19 -0
- package/bundles/antigravity-plugin-extras/skills/theme-factory/themes/forest-canopy.md +19 -0
- package/bundles/antigravity-plugin-extras/skills/theme-factory/themes/golden-hour.md +19 -0
- package/bundles/antigravity-plugin-extras/skills/theme-factory/themes/midnight-galaxy.md +19 -0
- package/bundles/antigravity-plugin-extras/skills/theme-factory/themes/modern-minimalist.md +19 -0
- package/bundles/antigravity-plugin-extras/skills/theme-factory/themes/ocean-depths.md +19 -0
- package/bundles/antigravity-plugin-extras/skills/theme-factory/themes/sunset-boulevard.md +19 -0
- package/bundles/antigravity-plugin-extras/skills/theme-factory/themes/tech-innovation.md +19 -0
- package/bundles/antigravity-plugin-extras/skills/ui-styling-patterns/LICENSE.txt +202 -0
- package/bundles/antigravity-plugin-extras/skills/ui-styling-patterns/SKILL.md +320 -0
- package/bundles/antigravity-plugin-extras/skills/ui-testing/SKILL.md +660 -0
- package/bundles/antigravity-plugin-extras/skills/ui-ux-intelligence/SKILL.md +660 -0
- package/bundles/antigravity-plugin-extras/skills/ui-ux-intelligence/data/_sync_all.py +414 -0
- package/bundles/antigravity-plugin-extras/skills/ui-ux-intelligence/data/app-interface.csv +31 -0
- package/bundles/antigravity-plugin-extras/skills/ui-ux-intelligence/data/charts.csv +26 -0
- package/bundles/antigravity-plugin-extras/skills/ui-ux-intelligence/data/colors.csv +162 -0
- package/bundles/antigravity-plugin-extras/skills/ui-ux-intelligence/data/design.csv +1776 -0
- package/bundles/antigravity-plugin-extras/skills/ui-ux-intelligence/data/draft.csv +1779 -0
- package/bundles/antigravity-plugin-extras/skills/ui-ux-intelligence/data/google-fonts.csv +1924 -0
- package/bundles/antigravity-plugin-extras/skills/ui-ux-intelligence/data/icons.csv +106 -0
- package/bundles/antigravity-plugin-extras/skills/ui-ux-intelligence/data/landing.csv +35 -0
- package/bundles/antigravity-plugin-extras/skills/ui-ux-intelligence/data/products.csv +162 -0
- package/bundles/antigravity-plugin-extras/skills/ui-ux-intelligence/data/react-performance.csv +45 -0
- package/bundles/antigravity-plugin-extras/skills/ui-ux-intelligence/data/styles.csv +85 -0
- package/bundles/antigravity-plugin-extras/skills/ui-ux-intelligence/data/typography.csv +74 -0
- package/bundles/antigravity-plugin-extras/skills/ui-ux-intelligence/data/ui-reasoning.csv +162 -0
- package/bundles/antigravity-plugin-extras/skills/ui-ux-intelligence/data/ux-guidelines.csv +100 -0
- package/bundles/antigravity-plugin-extras/skills/ui-ux-intelligence/scripts/core.py +247 -0
- package/bundles/antigravity-plugin-extras/skills/ui-ux-intelligence/scripts/design_system.py +1067 -0
- package/bundles/antigravity-plugin-extras/skills/ui-ux-intelligence/scripts/search.py +114 -0
- package/bundles/antigravity-plugin-extras/skills/understand-anything/SKILL.md +140 -0
- package/bundles/antigravity-plugin-extras/skills/understand-anything/references/commands.md +252 -0
- package/bundles/antigravity-plugin-extras/skills/understand-anything/references/graph-schema.md +116 -0
- package/bundles/antigravity-plugin-extras/skills/understand-anything/references/pipeline.md +331 -0
- package/bundles/antigravity-plugin-extras/skills/update-readme/SKILL.md +74 -0
- package/bundles/antigravity-plugin-extras/skills/verification-loop/SKILL.md +209 -0
- package/bundles/antigravity-plugin-extras/skills/video-downloader/SKILL.md +107 -0
- package/bundles/antigravity-plugin-extras/skills/webapp-development/SKILL.md +288 -0
- package/bundles/antigravity-plugin-extras/skills/word-cloud/SKILL.md +339 -0
- package/bundles/antigravity-plugin-extras/skills/word-cloud/agents/agent-interface.md +175 -0
- package/bundles/antigravity-plugin-extras/skills/word-cloud/references/html.md +384 -0
- package/bundles/antigravity-plugin-extras/skills/word-cloud/references/nlp-keywords.md +127 -0
- package/bundles/antigravity-plugin-extras/skills/word-cloud/references/palettes.md +149 -0
- package/bundles/antigravity-plugin-extras/skills/word-cloud/references/python.md +249 -0
- package/bundles/antigravity-plugin-extras/skills/word-cloud/references/react.md +427 -0
- package/bundles/antigravity-plugin-extras/skills/word-cloud/references/shapes.md +135 -0
- package/bundles/antigravity-plugin-extras/skills/word-cloud/references/stopwords.md +115 -0
- package/bundles/antigravity-plugin-extras/skills/youtube-transcript/SKILL.md +416 -0
- package/bundles/manifest.json +2 -1
- package/dist/cli.js +166 -37
- package/package.json +1 -1
|
@@ -0,0 +1,770 @@
|
|
|
1
|
+
# Serverless Observability Best Practices
|
|
2
|
+
|
|
3
|
+
Comprehensive observability patterns for serverless applications based on AWS best practices.
|
|
4
|
+
|
|
5
|
+
## Table of Contents
|
|
6
|
+
|
|
7
|
+
- [Three Pillars of Observability](#three-pillars-of-observability)
|
|
8
|
+
- [Metrics](#metrics)
|
|
9
|
+
- [Logging](#logging)
|
|
10
|
+
- [Tracing](#tracing)
|
|
11
|
+
- [Unified Observability](#unified-observability)
|
|
12
|
+
- [Alerting](#alerting)
|
|
13
|
+
|
|
14
|
+
## Three Pillars of Observability
|
|
15
|
+
|
|
16
|
+
### Metrics
|
|
17
|
+
**Numeric data measured at intervals (time series)**
|
|
18
|
+
- Request rate, error rate, duration
|
|
19
|
+
- CPU%, memory%, disk%
|
|
20
|
+
- Custom business metrics
|
|
21
|
+
- Service Level Indicators (SLIs)
|
|
22
|
+
|
|
23
|
+
### Logs
|
|
24
|
+
**Timestamped records of discrete events**
|
|
25
|
+
- Application events and errors
|
|
26
|
+
- State transformations
|
|
27
|
+
- Debugging information
|
|
28
|
+
- Audit trails
|
|
29
|
+
|
|
30
|
+
### Traces
|
|
31
|
+
**Single user's journey across services**
|
|
32
|
+
- Request flow through distributed system
|
|
33
|
+
- Service dependencies
|
|
34
|
+
- Latency breakdown
|
|
35
|
+
- Error propagation
|
|
36
|
+
|
|
37
|
+
## Metrics
|
|
38
|
+
|
|
39
|
+
### CloudWatch Metrics for Lambda
|
|
40
|
+
|
|
41
|
+
**Out-of-the-box metrics** (automatically available):
|
|
42
|
+
```
|
|
43
|
+
- Invocations
|
|
44
|
+
- Errors
|
|
45
|
+
- Throttles
|
|
46
|
+
- Duration
|
|
47
|
+
- ConcurrentExecutions
|
|
48
|
+
- IteratorAge (for streams)
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
**CDK Configuration**:
|
|
52
|
+
```typescript
|
|
53
|
+
const fn = new NodejsFunction(this, 'Function', {
|
|
54
|
+
entry: 'src/handler.ts',
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
// Create alarms on metrics
|
|
58
|
+
new cloudwatch.Alarm(this, 'ErrorAlarm', {
|
|
59
|
+
metric: fn.metricErrors({
|
|
60
|
+
statistic: 'Sum',
|
|
61
|
+
period: Duration.minutes(5),
|
|
62
|
+
}),
|
|
63
|
+
threshold: 10,
|
|
64
|
+
evaluationPeriods: 1,
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
new cloudwatch.Alarm(this, 'DurationAlarm', {
|
|
68
|
+
metric: fn.metricDuration({
|
|
69
|
+
statistic: 'p99',
|
|
70
|
+
period: Duration.minutes(5),
|
|
71
|
+
}),
|
|
72
|
+
threshold: 1000, // 1 second
|
|
73
|
+
evaluationPeriods: 2,
|
|
74
|
+
});
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### Custom Metrics
|
|
78
|
+
|
|
79
|
+
**Use CloudWatch Embedded Metric Format (EMF)**:
|
|
80
|
+
|
|
81
|
+
```typescript
|
|
82
|
+
export const handler = async (event: any) => {
|
|
83
|
+
const startTime = Date.now();
|
|
84
|
+
|
|
85
|
+
try {
|
|
86
|
+
const result = await processOrder(event);
|
|
87
|
+
|
|
88
|
+
// Emit custom metrics
|
|
89
|
+
console.log(JSON.stringify({
|
|
90
|
+
_aws: {
|
|
91
|
+
Timestamp: Date.now(),
|
|
92
|
+
CloudWatchMetrics: [{
|
|
93
|
+
Namespace: 'MyApp/Orders',
|
|
94
|
+
Dimensions: [['ServiceName', 'Operation']],
|
|
95
|
+
Metrics: [
|
|
96
|
+
{ Name: 'ProcessingTime', Unit: 'Milliseconds' },
|
|
97
|
+
{ Name: 'OrderValue', Unit: 'None' },
|
|
98
|
+
],
|
|
99
|
+
}],
|
|
100
|
+
},
|
|
101
|
+
ServiceName: 'OrderService',
|
|
102
|
+
Operation: 'ProcessOrder',
|
|
103
|
+
ProcessingTime: Date.now() - startTime,
|
|
104
|
+
OrderValue: result.amount,
|
|
105
|
+
}));
|
|
106
|
+
|
|
107
|
+
return result;
|
|
108
|
+
} catch (error) {
|
|
109
|
+
// Emit error metric
|
|
110
|
+
console.log(JSON.stringify({
|
|
111
|
+
_aws: {
|
|
112
|
+
CloudWatchMetrics: [{
|
|
113
|
+
Namespace: 'MyApp/Orders',
|
|
114
|
+
Dimensions: [['ServiceName']],
|
|
115
|
+
Metrics: [{ Name: 'Errors', Unit: 'Count' }],
|
|
116
|
+
}],
|
|
117
|
+
},
|
|
118
|
+
ServiceName: 'OrderService',
|
|
119
|
+
Errors: 1,
|
|
120
|
+
}));
|
|
121
|
+
|
|
122
|
+
throw error;
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
**Using Lambda Powertools**:
|
|
128
|
+
|
|
129
|
+
```typescript
|
|
130
|
+
import { Metrics, MetricUnits } from '@aws-lambda-powertools/metrics';
|
|
131
|
+
|
|
132
|
+
const metrics = new Metrics({
|
|
133
|
+
namespace: 'MyApp',
|
|
134
|
+
serviceName: 'OrderService',
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
export const handler = async (event: any) => {
|
|
138
|
+
metrics.addMetric('Invocation', MetricUnits.Count, 1);
|
|
139
|
+
|
|
140
|
+
const startTime = Date.now();
|
|
141
|
+
|
|
142
|
+
try {
|
|
143
|
+
const result = await processOrder(event);
|
|
144
|
+
|
|
145
|
+
metrics.addMetric('Success', MetricUnits.Count, 1);
|
|
146
|
+
metrics.addMetric('ProcessingTime', MetricUnits.Milliseconds, Date.now() - startTime);
|
|
147
|
+
metrics.addMetric('OrderValue', MetricUnits.None, result.amount);
|
|
148
|
+
|
|
149
|
+
return result;
|
|
150
|
+
} catch (error) {
|
|
151
|
+
metrics.addMetric('Error', MetricUnits.Count, 1);
|
|
152
|
+
throw error;
|
|
153
|
+
} finally {
|
|
154
|
+
metrics.publishStoredMetrics();
|
|
155
|
+
}
|
|
156
|
+
};
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
## Logging
|
|
160
|
+
|
|
161
|
+
### Structured Logging
|
|
162
|
+
|
|
163
|
+
**Use JSON format for logs**:
|
|
164
|
+
|
|
165
|
+
```typescript
|
|
166
|
+
// ✅ GOOD - Structured JSON logging
|
|
167
|
+
export const handler = async (event: any) => {
|
|
168
|
+
console.log(JSON.stringify({
|
|
169
|
+
level: 'INFO',
|
|
170
|
+
message: 'Processing order',
|
|
171
|
+
orderId: event.orderId,
|
|
172
|
+
customerId: event.customerId,
|
|
173
|
+
timestamp: new Date().toISOString(),
|
|
174
|
+
requestId: context.requestId,
|
|
175
|
+
}));
|
|
176
|
+
|
|
177
|
+
try {
|
|
178
|
+
const result = await processOrder(event);
|
|
179
|
+
|
|
180
|
+
console.log(JSON.stringify({
|
|
181
|
+
level: 'INFO',
|
|
182
|
+
message: 'Order processed successfully',
|
|
183
|
+
orderId: event.orderId,
|
|
184
|
+
duration: Date.now() - startTime,
|
|
185
|
+
timestamp: new Date().toISOString(),
|
|
186
|
+
}));
|
|
187
|
+
|
|
188
|
+
return result;
|
|
189
|
+
} catch (error) {
|
|
190
|
+
console.error(JSON.stringify({
|
|
191
|
+
level: 'ERROR',
|
|
192
|
+
message: 'Order processing failed',
|
|
193
|
+
orderId: event.orderId,
|
|
194
|
+
error: {
|
|
195
|
+
name: error.name,
|
|
196
|
+
message: error.message,
|
|
197
|
+
stack: error.stack,
|
|
198
|
+
},
|
|
199
|
+
timestamp: new Date().toISOString(),
|
|
200
|
+
}));
|
|
201
|
+
|
|
202
|
+
throw error;
|
|
203
|
+
}
|
|
204
|
+
};
|
|
205
|
+
|
|
206
|
+
// ❌ BAD - Unstructured logging
|
|
207
|
+
console.log('Processing order ' + orderId + ' for customer ' + customerId);
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
**Using Lambda Powertools Logger**:
|
|
211
|
+
|
|
212
|
+
```typescript
|
|
213
|
+
import { Logger } from '@aws-lambda-powertools/logger';
|
|
214
|
+
|
|
215
|
+
const logger = new Logger({
|
|
216
|
+
serviceName: 'OrderService',
|
|
217
|
+
logLevel: 'INFO',
|
|
218
|
+
});
|
|
219
|
+
|
|
220
|
+
export const handler = async (event: any, context: Context) => {
|
|
221
|
+
logger.addContext(context);
|
|
222
|
+
|
|
223
|
+
logger.info('Processing order', {
|
|
224
|
+
orderId: event.orderId,
|
|
225
|
+
customerId: event.customerId,
|
|
226
|
+
});
|
|
227
|
+
|
|
228
|
+
try {
|
|
229
|
+
const result = await processOrder(event);
|
|
230
|
+
|
|
231
|
+
logger.info('Order processed', {
|
|
232
|
+
orderId: event.orderId,
|
|
233
|
+
amount: result.amount,
|
|
234
|
+
});
|
|
235
|
+
|
|
236
|
+
return result;
|
|
237
|
+
} catch (error) {
|
|
238
|
+
logger.error('Order processing failed', {
|
|
239
|
+
orderId: event.orderId,
|
|
240
|
+
error,
|
|
241
|
+
});
|
|
242
|
+
|
|
243
|
+
throw error;
|
|
244
|
+
}
|
|
245
|
+
};
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
### Log Levels
|
|
249
|
+
|
|
250
|
+
**Use appropriate log levels**:
|
|
251
|
+
- **ERROR**: Errors requiring immediate attention
|
|
252
|
+
- **WARN**: Warnings or recoverable errors
|
|
253
|
+
- **INFO**: Important business events
|
|
254
|
+
- **DEBUG**: Detailed debugging information (disable in production)
|
|
255
|
+
|
|
256
|
+
```typescript
|
|
257
|
+
const logger = new Logger({
|
|
258
|
+
serviceName: 'OrderService',
|
|
259
|
+
logLevel: process.env.LOG_LEVEL || 'INFO',
|
|
260
|
+
});
|
|
261
|
+
|
|
262
|
+
logger.debug('Detailed processing info', { data });
|
|
263
|
+
logger.info('Business event occurred', { event });
|
|
264
|
+
logger.warn('Recoverable error', { error });
|
|
265
|
+
logger.error('Critical failure', { error });
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
### Log Insights Queries
|
|
269
|
+
|
|
270
|
+
**Common CloudWatch Logs Insights queries**:
|
|
271
|
+
|
|
272
|
+
```
|
|
273
|
+
# Find errors in last hour
|
|
274
|
+
fields @timestamp, @message, level, error.message
|
|
275
|
+
| filter level = "ERROR"
|
|
276
|
+
| sort @timestamp desc
|
|
277
|
+
| limit 100
|
|
278
|
+
|
|
279
|
+
# Count errors by type
|
|
280
|
+
stats count() by error.name as ErrorType
|
|
281
|
+
| sort count desc
|
|
282
|
+
|
|
283
|
+
# Calculate p99 latency
|
|
284
|
+
stats percentile(duration, 99) by serviceName
|
|
285
|
+
|
|
286
|
+
# Find slow requests
|
|
287
|
+
fields @timestamp, orderId, duration
|
|
288
|
+
| filter duration > 1000
|
|
289
|
+
| sort duration desc
|
|
290
|
+
| limit 50
|
|
291
|
+
|
|
292
|
+
# Track specific customer requests
|
|
293
|
+
fields @timestamp, @message, orderId
|
|
294
|
+
| filter customerId = "customer-123"
|
|
295
|
+
| sort @timestamp desc
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
## Tracing
|
|
299
|
+
|
|
300
|
+
### Enable X-Ray Tracing
|
|
301
|
+
|
|
302
|
+
**Configure X-Ray for Lambda**:
|
|
303
|
+
|
|
304
|
+
```typescript
|
|
305
|
+
const fn = new NodejsFunction(this, 'Function', {
|
|
306
|
+
entry: 'src/handler.ts',
|
|
307
|
+
tracing: lambda.Tracing.ACTIVE, // Enable X-Ray
|
|
308
|
+
});
|
|
309
|
+
|
|
310
|
+
// API Gateway tracing
|
|
311
|
+
const api = new apigateway.RestApi(this, 'Api', {
|
|
312
|
+
deployOptions: {
|
|
313
|
+
tracingEnabled: true,
|
|
314
|
+
},
|
|
315
|
+
});
|
|
316
|
+
|
|
317
|
+
// Step Functions tracing
|
|
318
|
+
new stepfunctions.StateMachine(this, 'StateMachine', {
|
|
319
|
+
definition,
|
|
320
|
+
tracingEnabled: true,
|
|
321
|
+
});
|
|
322
|
+
```
|
|
323
|
+
|
|
324
|
+
**Instrument application code**:
|
|
325
|
+
|
|
326
|
+
```typescript
|
|
327
|
+
import { captureAWSv3Client } from 'aws-xray-sdk-core';
|
|
328
|
+
import { DynamoDBClient } from '@aws-sdk/client-dynamodb';
|
|
329
|
+
|
|
330
|
+
// Wrap AWS SDK clients
|
|
331
|
+
const client = captureAWSv3Client(new DynamoDBClient({}));
|
|
332
|
+
|
|
333
|
+
// Custom segments
|
|
334
|
+
import AWSXRay from 'aws-xray-sdk-core';
|
|
335
|
+
|
|
336
|
+
export const handler = async (event: any) => {
|
|
337
|
+
const segment = AWSXRay.getSegment();
|
|
338
|
+
|
|
339
|
+
// Custom subsegment
|
|
340
|
+
const subsegment = segment.addNewSubsegment('ProcessOrder');
|
|
341
|
+
|
|
342
|
+
try {
|
|
343
|
+
// Add annotations (indexed for filtering)
|
|
344
|
+
subsegment.addAnnotation('orderId', event.orderId);
|
|
345
|
+
subsegment.addAnnotation('customerId', event.customerId);
|
|
346
|
+
|
|
347
|
+
// Add metadata (not indexed, detailed info)
|
|
348
|
+
subsegment.addMetadata('orderDetails', event);
|
|
349
|
+
|
|
350
|
+
const result = await processOrder(event);
|
|
351
|
+
|
|
352
|
+
subsegment.addAnnotation('status', 'success');
|
|
353
|
+
subsegment.close();
|
|
354
|
+
|
|
355
|
+
return result;
|
|
356
|
+
} catch (error) {
|
|
357
|
+
subsegment.addError(error);
|
|
358
|
+
subsegment.close();
|
|
359
|
+
throw error;
|
|
360
|
+
}
|
|
361
|
+
};
|
|
362
|
+
```
|
|
363
|
+
|
|
364
|
+
**Using Lambda Powertools Tracer**:
|
|
365
|
+
|
|
366
|
+
```typescript
|
|
367
|
+
import { Tracer } from '@aws-lambda-powertools/tracer';
|
|
368
|
+
|
|
369
|
+
const tracer = new Tracer({ serviceName: 'OrderService' });
|
|
370
|
+
|
|
371
|
+
export const handler = async (event: any) => {
|
|
372
|
+
const segment = tracer.getSegment();
|
|
373
|
+
|
|
374
|
+
// Automatically captures and traces
|
|
375
|
+
const result = await tracer.captureAWSv3Client(dynamodb).getItem({
|
|
376
|
+
TableName: process.env.TABLE_NAME,
|
|
377
|
+
Key: { orderId: event.orderId },
|
|
378
|
+
});
|
|
379
|
+
|
|
380
|
+
// Custom annotation
|
|
381
|
+
tracer.putAnnotation('orderId', event.orderId);
|
|
382
|
+
tracer.putMetadata('orderDetails', event);
|
|
383
|
+
|
|
384
|
+
return result;
|
|
385
|
+
};
|
|
386
|
+
```
|
|
387
|
+
|
|
388
|
+
### Service Map
|
|
389
|
+
|
|
390
|
+
**Visualize service dependencies** with X-Ray:
|
|
391
|
+
- Shows service-to-service communication
|
|
392
|
+
- Identifies latency bottlenecks
|
|
393
|
+
- Highlights error rates between services
|
|
394
|
+
- Tracks downstream dependencies
|
|
395
|
+
|
|
396
|
+
### Distributed Tracing Best Practices
|
|
397
|
+
|
|
398
|
+
1. **Enable tracing everywhere**: Lambda, API Gateway, Step Functions
|
|
399
|
+
2. **Use annotations for filtering**: Indexed fields for queries
|
|
400
|
+
3. **Use metadata for details**: Non-indexed detailed information
|
|
401
|
+
4. **Sample appropriately**: 100% for low traffic, sampled for high traffic
|
|
402
|
+
5. **Correlate with logs**: Include trace ID in log entries
|
|
403
|
+
|
|
404
|
+
## Unified Observability
|
|
405
|
+
|
|
406
|
+
### Correlation Between Pillars
|
|
407
|
+
|
|
408
|
+
**Include trace ID in logs**:
|
|
409
|
+
|
|
410
|
+
```typescript
|
|
411
|
+
export const handler = async (event: any, context: Context) => {
|
|
412
|
+
const traceId = process.env._X_AMZN_TRACE_ID;
|
|
413
|
+
|
|
414
|
+
console.log(JSON.stringify({
|
|
415
|
+
level: 'INFO',
|
|
416
|
+
message: 'Processing order',
|
|
417
|
+
traceId,
|
|
418
|
+
requestId: context.requestId,
|
|
419
|
+
orderId: event.orderId,
|
|
420
|
+
}));
|
|
421
|
+
};
|
|
422
|
+
```
|
|
423
|
+
|
|
424
|
+
### CloudWatch ServiceLens
|
|
425
|
+
|
|
426
|
+
**Unified view of traces and metrics**:
|
|
427
|
+
- Automatically correlates X-Ray traces with CloudWatch metrics
|
|
428
|
+
- Shows service map with metrics overlay
|
|
429
|
+
- Identifies performance and availability issues
|
|
430
|
+
- Provides end-to-end request view
|
|
431
|
+
|
|
432
|
+
### Lambda Powertools Integration
|
|
433
|
+
|
|
434
|
+
**All three pillars in one**:
|
|
435
|
+
|
|
436
|
+
```typescript
|
|
437
|
+
import { Logger } from '@aws-lambda-powertools/logger';
|
|
438
|
+
import { Tracer } from '@aws-lambda-powertools/tracer';
|
|
439
|
+
import { Metrics, MetricUnits } from '@aws-lambda-powertools/metrics';
|
|
440
|
+
|
|
441
|
+
const logger = new Logger({ serviceName: 'OrderService' });
|
|
442
|
+
const tracer = new Tracer({ serviceName: 'OrderService' });
|
|
443
|
+
const metrics = new Metrics({ namespace: 'MyApp', serviceName: 'OrderService' });
|
|
444
|
+
|
|
445
|
+
export const handler = async (event: any, context: Context) => {
|
|
446
|
+
// Automatically adds trace context to logs
|
|
447
|
+
logger.addContext(context);
|
|
448
|
+
|
|
449
|
+
logger.info('Processing order', { orderId: event.orderId });
|
|
450
|
+
|
|
451
|
+
// Add trace annotations
|
|
452
|
+
tracer.putAnnotation('orderId', event.orderId);
|
|
453
|
+
|
|
454
|
+
// Add metrics
|
|
455
|
+
metrics.addMetric('Invocation', MetricUnits.Count, 1);
|
|
456
|
+
|
|
457
|
+
const startTime = Date.now();
|
|
458
|
+
|
|
459
|
+
try {
|
|
460
|
+
const result = await processOrder(event);
|
|
461
|
+
|
|
462
|
+
metrics.addMetric('Success', MetricUnits.Count, 1);
|
|
463
|
+
metrics.addMetric('Duration', MetricUnits.Milliseconds, Date.now() - startTime);
|
|
464
|
+
|
|
465
|
+
logger.info('Order processed', { orderId: event.orderId });
|
|
466
|
+
|
|
467
|
+
return result;
|
|
468
|
+
} catch (error) {
|
|
469
|
+
metrics.addMetric('Error', MetricUnits.Count, 1);
|
|
470
|
+
logger.error('Processing failed', { orderId: event.orderId, error });
|
|
471
|
+
throw error;
|
|
472
|
+
} finally {
|
|
473
|
+
metrics.publishStoredMetrics();
|
|
474
|
+
}
|
|
475
|
+
};
|
|
476
|
+
```
|
|
477
|
+
|
|
478
|
+
## Alerting
|
|
479
|
+
|
|
480
|
+
### Effective Alerting Strategy
|
|
481
|
+
|
|
482
|
+
**Alert on what matters**:
|
|
483
|
+
- **Critical**: Customer-impacting issues (errors, high latency)
|
|
484
|
+
- **Warning**: Approaching thresholds (80% capacity)
|
|
485
|
+
- **Info**: Trends and anomalies (cost spikes)
|
|
486
|
+
|
|
487
|
+
**Alarm fatigue prevention**:
|
|
488
|
+
- Tune thresholds based on actual patterns
|
|
489
|
+
- Use composite alarms to reduce noise
|
|
490
|
+
- Set appropriate evaluation periods
|
|
491
|
+
- Include clear remediation steps
|
|
492
|
+
|
|
493
|
+
### CloudWatch Alarms
|
|
494
|
+
|
|
495
|
+
**Common alarm patterns**:
|
|
496
|
+
|
|
497
|
+
```typescript
|
|
498
|
+
// Error rate alarm
|
|
499
|
+
new cloudwatch.Alarm(this, 'ErrorRateAlarm', {
|
|
500
|
+
metric: new cloudwatch.MathExpression({
|
|
501
|
+
expression: 'errors / invocations * 100',
|
|
502
|
+
usingMetrics: {
|
|
503
|
+
errors: fn.metricErrors({ statistic: 'Sum' }),
|
|
504
|
+
invocations: fn.metricInvocations({ statistic: 'Sum' }),
|
|
505
|
+
},
|
|
506
|
+
}),
|
|
507
|
+
threshold: 1, // 1% error rate
|
|
508
|
+
evaluationPeriods: 2,
|
|
509
|
+
alarmDescription: 'Error rate exceeded 1%',
|
|
510
|
+
});
|
|
511
|
+
|
|
512
|
+
// Latency alarm (p99)
|
|
513
|
+
new cloudwatch.Alarm(this, 'LatencyAlarm', {
|
|
514
|
+
metric: fn.metricDuration({
|
|
515
|
+
statistic: 'p99',
|
|
516
|
+
period: Duration.minutes(5),
|
|
517
|
+
}),
|
|
518
|
+
threshold: 1000, // 1 second
|
|
519
|
+
evaluationPeriods: 2,
|
|
520
|
+
alarmDescription: 'p99 latency exceeded 1 second',
|
|
521
|
+
});
|
|
522
|
+
|
|
523
|
+
// Concurrent executions approaching limit
|
|
524
|
+
new cloudwatch.Alarm(this, 'ConcurrencyAlarm', {
|
|
525
|
+
metric: fn.metricConcurrentExecutions({
|
|
526
|
+
statistic: 'Maximum',
|
|
527
|
+
}),
|
|
528
|
+
threshold: 800, // 80% of 1000 default limit
|
|
529
|
+
evaluationPeriods: 1,
|
|
530
|
+
alarmDescription: 'Approaching concurrency limit',
|
|
531
|
+
});
|
|
532
|
+
```
|
|
533
|
+
|
|
534
|
+
### Composite Alarms
|
|
535
|
+
|
|
536
|
+
**Reduce alert noise**:
|
|
537
|
+
|
|
538
|
+
```typescript
|
|
539
|
+
const errorAlarm = new cloudwatch.Alarm(this, 'Errors', {
|
|
540
|
+
metric: fn.metricErrors(),
|
|
541
|
+
threshold: 10,
|
|
542
|
+
evaluationPeriods: 1,
|
|
543
|
+
});
|
|
544
|
+
|
|
545
|
+
const throttleAlarm = new cloudwatch.Alarm(this, 'Throttles', {
|
|
546
|
+
metric: fn.metricThrottles(),
|
|
547
|
+
threshold: 5,
|
|
548
|
+
evaluationPeriods: 1,
|
|
549
|
+
});
|
|
550
|
+
|
|
551
|
+
const latencyAlarm = new cloudwatch.Alarm(this, 'Latency', {
|
|
552
|
+
metric: fn.metricDuration({ statistic: 'p99' }),
|
|
553
|
+
threshold: 2000,
|
|
554
|
+
evaluationPeriods: 2,
|
|
555
|
+
});
|
|
556
|
+
|
|
557
|
+
// Composite alarm (any of the above)
|
|
558
|
+
new cloudwatch.CompositeAlarm(this, 'ServiceHealthAlarm', {
|
|
559
|
+
compositeAlarmName: 'order-service-health',
|
|
560
|
+
alarmRule: cloudwatch.AlarmRule.anyOf(
|
|
561
|
+
errorAlarm,
|
|
562
|
+
throttleAlarm,
|
|
563
|
+
latencyAlarm
|
|
564
|
+
),
|
|
565
|
+
alarmDescription: 'Overall service health degraded',
|
|
566
|
+
});
|
|
567
|
+
```
|
|
568
|
+
|
|
569
|
+
## Dashboard Best Practices
|
|
570
|
+
|
|
571
|
+
### Service Dashboard Layout
|
|
572
|
+
|
|
573
|
+
**Recommended sections**:
|
|
574
|
+
|
|
575
|
+
1. **Overview**:
|
|
576
|
+
- Total invocations
|
|
577
|
+
- Error rate percentage
|
|
578
|
+
- P50, P95, P99 latency
|
|
579
|
+
- Availability percentage
|
|
580
|
+
|
|
581
|
+
2. **Resource Utilization**:
|
|
582
|
+
- Concurrent executions
|
|
583
|
+
- Memory utilization
|
|
584
|
+
- Duration distribution
|
|
585
|
+
- Throttles
|
|
586
|
+
|
|
587
|
+
3. **Business Metrics**:
|
|
588
|
+
- Orders processed
|
|
589
|
+
- Revenue per minute
|
|
590
|
+
- Customer activity
|
|
591
|
+
- Feature usage
|
|
592
|
+
|
|
593
|
+
4. **Errors and Alerts**:
|
|
594
|
+
- Error count by type
|
|
595
|
+
- Active alarms
|
|
596
|
+
- DLQ message count
|
|
597
|
+
- Failed transactions
|
|
598
|
+
|
|
599
|
+
### CloudWatch Dashboard CDK
|
|
600
|
+
|
|
601
|
+
```typescript
|
|
602
|
+
const dashboard = new cloudwatch.Dashboard(this, 'ServiceDashboard', {
|
|
603
|
+
dashboardName: 'order-service',
|
|
604
|
+
});
|
|
605
|
+
|
|
606
|
+
dashboard.addWidgets(
|
|
607
|
+
// Row 1: Overview
|
|
608
|
+
new cloudwatch.GraphWidget({
|
|
609
|
+
title: 'Invocations',
|
|
610
|
+
left: [fn.metricInvocations()],
|
|
611
|
+
}),
|
|
612
|
+
new cloudwatch.SingleValueWidget({
|
|
613
|
+
title: 'Error Rate',
|
|
614
|
+
metrics: [
|
|
615
|
+
new cloudwatch.MathExpression({
|
|
616
|
+
expression: 'errors / invocations * 100',
|
|
617
|
+
usingMetrics: {
|
|
618
|
+
errors: fn.metricErrors({ statistic: 'Sum' }),
|
|
619
|
+
invocations: fn.metricInvocations({ statistic: 'Sum' }),
|
|
620
|
+
},
|
|
621
|
+
}),
|
|
622
|
+
],
|
|
623
|
+
}),
|
|
624
|
+
new cloudwatch.GraphWidget({
|
|
625
|
+
title: 'Latency (p50, p95, p99)',
|
|
626
|
+
left: [
|
|
627
|
+
fn.metricDuration({ statistic: 'p50', label: 'p50' }),
|
|
628
|
+
fn.metricDuration({ statistic: 'p95', label: 'p95' }),
|
|
629
|
+
fn.metricDuration({ statistic: 'p99', label: 'p99' }),
|
|
630
|
+
],
|
|
631
|
+
})
|
|
632
|
+
);
|
|
633
|
+
|
|
634
|
+
// Row 2: Errors
|
|
635
|
+
dashboard.addWidgets(
|
|
636
|
+
new cloudwatch.LogQueryWidget({
|
|
637
|
+
title: 'Recent Errors',
|
|
638
|
+
logGroupNames: [fn.logGroup.logGroupName],
|
|
639
|
+
queryLines: [
|
|
640
|
+
'fields @timestamp, @message',
|
|
641
|
+
'filter level = "ERROR"',
|
|
642
|
+
'sort @timestamp desc',
|
|
643
|
+
'limit 20',
|
|
644
|
+
],
|
|
645
|
+
})
|
|
646
|
+
);
|
|
647
|
+
```
|
|
648
|
+
|
|
649
|
+
## Monitoring Serverless Architectures
|
|
650
|
+
|
|
651
|
+
### End-to-End Monitoring
|
|
652
|
+
|
|
653
|
+
**Monitor the entire flow**:
|
|
654
|
+
|
|
655
|
+
```
|
|
656
|
+
API Gateway → Lambda → DynamoDB → EventBridge → Lambda
|
|
657
|
+
↓ ↓ ↓ ↓ ↓
|
|
658
|
+
Metrics Traces Metrics Metrics Logs
|
|
659
|
+
```
|
|
660
|
+
|
|
661
|
+
**Key metrics per service**:
|
|
662
|
+
|
|
663
|
+
| Service | Key Metrics |
|
|
664
|
+
|---------|-------------|
|
|
665
|
+
| API Gateway | Count, 4XXError, 5XXError, Latency, CacheHitCount |
|
|
666
|
+
| Lambda | Invocations, Errors, Duration, Throttles, ConcurrentExecutions |
|
|
667
|
+
| DynamoDB | ConsumedReadCapacity, ConsumedWriteCapacity, UserErrors, SystemErrors |
|
|
668
|
+
| SQS | NumberOfMessagesSent, NumberOfMessagesReceived, ApproximateAgeOfOldestMessage |
|
|
669
|
+
| EventBridge | Invocations, FailedInvocations, TriggeredRules |
|
|
670
|
+
| Step Functions | ExecutionsStarted, ExecutionsFailed, ExecutionTime |
|
|
671
|
+
|
|
672
|
+
### Synthetic Monitoring
|
|
673
|
+
|
|
674
|
+
**Use CloudWatch Synthetics for API monitoring**:
|
|
675
|
+
|
|
676
|
+
```typescript
|
|
677
|
+
import { Canary, Test, Code, Schedule } from '@aws-cdk/aws-synthetics-alpha';
|
|
678
|
+
|
|
679
|
+
new Canary(this, 'ApiCanary', {
|
|
680
|
+
canaryName: 'api-health-check',
|
|
681
|
+
schedule: Schedule.rate(Duration.minutes(5)),
|
|
682
|
+
test: Test.custom({
|
|
683
|
+
code: Code.fromInline(`
|
|
684
|
+
const synthetics = require('Synthetics');
|
|
685
|
+
|
|
686
|
+
const apiCanaryBlueprint = async function () {
|
|
687
|
+
const response = await synthetics.executeHttpStep('Verify API', {
|
|
688
|
+
url: 'https://api.example.com/health',
|
|
689
|
+
method: 'GET',
|
|
690
|
+
});
|
|
691
|
+
|
|
692
|
+
return response.statusCode === 200 ? 'success' : 'failure';
|
|
693
|
+
};
|
|
694
|
+
|
|
695
|
+
exports.handler = async () => {
|
|
696
|
+
return await apiCanaryBlueprint();
|
|
697
|
+
};
|
|
698
|
+
`),
|
|
699
|
+
handler: 'index.handler',
|
|
700
|
+
}),
|
|
701
|
+
runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_6_2,
|
|
702
|
+
});
|
|
703
|
+
```
|
|
704
|
+
|
|
705
|
+
## OpenTelemetry Integration
|
|
706
|
+
|
|
707
|
+
### Amazon Distro for OpenTelemetry (ADOT)
|
|
708
|
+
|
|
709
|
+
**Use ADOT for vendor-neutral observability**:
|
|
710
|
+
|
|
711
|
+
```typescript
|
|
712
|
+
// Lambda Layer with ADOT
|
|
713
|
+
const adotLayer = lambda.LayerVersion.fromLayerVersionArn(
|
|
714
|
+
this,
|
|
715
|
+
'AdotLayer',
|
|
716
|
+
`arn:aws:lambda:${this.region}:901920570463:layer:aws-otel-nodejs-amd64-ver-1-18-1:4`
|
|
717
|
+
);
|
|
718
|
+
|
|
719
|
+
new NodejsFunction(this, 'Function', {
|
|
720
|
+
entry: 'src/handler.ts',
|
|
721
|
+
layers: [adotLayer],
|
|
722
|
+
tracing: lambda.Tracing.ACTIVE,
|
|
723
|
+
environment: {
|
|
724
|
+
AWS_LAMBDA_EXEC_WRAPPER: '/opt/otel-handler',
|
|
725
|
+
OPENTELEMETRY_COLLECTOR_CONFIG_FILE: '/var/task/collector.yaml',
|
|
726
|
+
},
|
|
727
|
+
});
|
|
728
|
+
```
|
|
729
|
+
|
|
730
|
+
**Benefits of ADOT**:
|
|
731
|
+
- Vendor-neutral (works with Datadog, New Relic, Honeycomb, etc.)
|
|
732
|
+
- Automatic instrumentation
|
|
733
|
+
- Consistent format across services
|
|
734
|
+
- Export to multiple backends
|
|
735
|
+
|
|
736
|
+
## Best Practices Summary
|
|
737
|
+
|
|
738
|
+
### Metrics
|
|
739
|
+
- ✅ Use CloudWatch Embedded Metric Format (EMF)
|
|
740
|
+
- ✅ Track business metrics, not just technical metrics
|
|
741
|
+
- ✅ Set alarms on error rate, latency, and throughput
|
|
742
|
+
- ✅ Use p99 for latency, not average
|
|
743
|
+
- ✅ Create dashboards for key services
|
|
744
|
+
|
|
745
|
+
### Logging
|
|
746
|
+
- ✅ Use structured JSON logging
|
|
747
|
+
- ✅ Include correlation IDs (request ID, trace ID)
|
|
748
|
+
- ✅ Use appropriate log levels
|
|
749
|
+
- ✅ Never log sensitive data (PII, secrets)
|
|
750
|
+
- ✅ Use CloudWatch Logs Insights for analysis
|
|
751
|
+
|
|
752
|
+
### Tracing
|
|
753
|
+
- ✅ Enable X-Ray tracing on all services
|
|
754
|
+
- ✅ Instrument AWS SDK calls
|
|
755
|
+
- ✅ Add custom annotations for business context
|
|
756
|
+
- ✅ Use service map to understand dependencies
|
|
757
|
+
- ✅ Correlate traces with logs and metrics
|
|
758
|
+
|
|
759
|
+
### Alerting
|
|
760
|
+
- ✅ Alert on customer-impacting issues
|
|
761
|
+
- ✅ Tune thresholds to reduce false positives
|
|
762
|
+
- ✅ Use composite alarms to reduce noise
|
|
763
|
+
- ✅ Include clear remediation steps
|
|
764
|
+
- ✅ Escalate critical alarms appropriately
|
|
765
|
+
|
|
766
|
+
### Tools
|
|
767
|
+
- ✅ Use Lambda Powertools for unified observability
|
|
768
|
+
- ✅ Use CloudWatch ServiceLens for service view
|
|
769
|
+
- ✅ Use Synthetics for proactive monitoring
|
|
770
|
+
- ✅ Consider ADOT for vendor-neutral observability
|