[{"data":1,"prerenderedAt":72},["ShallowReactive",2],{"content-svc-lambda-guides-cost-optimization-3-cloudwatch":3},{"markdown":4,"frontMatterAttributes":5,"bodyRaw":8,"menu":9,"menuType":64,"isCollapseableMenu":12,"nextDocItem":33,"previousDocItem":21,"contributorPaths":65,"contentName":71,"slug":32,"readingTime":24},"\u003Cp>Lambda functions use \u003Ca href=\"https:\u002F\u002Fdocs.aws.amazon.com\u002FAmazonCloudWatch\u002Flatest\u002Flogs\u002FWhatIsCloudWatchLogs.html\">CloudWatch Logs\u003C\u002Fa> as their default logging destination. This logging includes output from the Lambda service as well as output from your function code. CloudWatch Logs charges for the collection, storage and analysis of data. Customers with unmanaged retention policies and\u002For overly verbose logging can sometimes accrue unnecessary charges.\u003C\u002Fp>\n\u003Cimg src=\"\u002Fassets\u002Fexternal\u002Fservice\u002Flambda\u002Fguides\u002Fcost-optimization\u002Fassets\u002Fcloudwatch-01.png\"\u002F>\n\n\u003Cp>Consider your log retention policies. Perhaps development environment logs only need to be retained for a week or less. If production logs remain valuable for longer durations, they can eventually be pushed to lower cost tiers within S3 and removed from CloudWatch entirely. By being attentive to log retention you can reduce your cost of log storage.\u003C\u002Fp>\n\u003Cimg src=\"\u002Fassets\u002Fexternal\u002Fservice\u002Flambda\u002Fguides\u002Fcost-optimization\u002Fassets\u002Fcloudwatch-02.png\"\u002F>\n\n\u003Cp>You can also reduce logging costs by being attentive to your log output. For example, you may want more verbose logging in pre-production environments, where debugging information is more valuable and your log volume is lower. You may want less verbose logging in production environments where debugging information is less necessary and your log volume is much greater. \u003C\u002Fp>\n\u003Cp>Lambda Powertools (available in \u003Ca href=\"https:\u002F\u002Fawslabs.github.io\u002Faws-lambda-powertools-python\u002F2.15.0\u002F\">Python\u003C\u002Fa>, \u003Ca href=\"https:\u002F\u002Fawslabs.github.io\u002Faws-lambda-powertools-typescript\u002Flatest\u002F\">TypeScript\u003C\u002Fa>, \u003Ca href=\"https:\u002F\u002Fawslabs.github.io\u002Faws-lambda-powertools-java\u002F\">Java\u003C\u002Fa>, and \u003Ca href=\"https:\u002F\u002Fawslabs.github.io\u002Faws-lambda-powertools-dotnet\u002F\">.NET\u003C\u002Fa>) provides structured logging tools that enable you to set log levels that can be configured on a per environment basis. \u003C\u002Fp>\n",{"title":6,"order":7},"3. Fine-tune CloudWatch Logs",3,"Lambda functions use [CloudWatch Logs](https:\u002F\u002Fdocs.aws.amazon.com\u002FAmazonCloudWatch\u002Flatest\u002Flogs\u002FWhatIsCloudWatchLogs.html) as their default logging destination. This logging includes output from the Lambda service as well as output from your function code. CloudWatch Logs charges for the collection, storage and analysis of data. Customers with unmanaged retention policies and\u002For overly verbose logging can sometimes accrue unnecessary charges.\n\n\u003Cimg src=\"\u002Fassets\u002Fexternal\u002Fservice\u002Flambda\u002Fguides\u002Fcost-optimization\u002Fassets\u002Fcloudwatch-01.png\"\u002F>\n\nConsider your log retention policies. Perhaps development environment logs only need to be retained for a week or less. If production logs remain valuable for longer durations, they can eventually be pushed to lower cost tiers within S3 and removed from CloudWatch entirely. By being attentive to log retention you can reduce your cost of log storage.\n\n\u003Cimg src=\"\u002Fassets\u002Fexternal\u002Fservice\u002Flambda\u002Fguides\u002Fcost-optimization\u002Fassets\u002Fcloudwatch-02.png\"\u002F>\n\nYou can also reduce logging costs by being attentive to your log output. For example, you may want more verbose logging in pre-production environments, where debugging information is more valuable and your log volume is lower. You may want less verbose logging in production environments where debugging information is less necessary and your log volume is much greater. \n\nLambda Powertools (available in [Python](https:\u002F\u002Fawslabs.github.io\u002Faws-lambda-powertools-python\u002F2.15.0\u002F), [TypeScript](https:\u002F\u002Fawslabs.github.io\u002Faws-lambda-powertools-typescript\u002Flatest\u002F), [Java](https:\u002F\u002Fawslabs.github.io\u002Faws-lambda-powertools-java\u002F), and [.NET](https:\u002F\u002Fawslabs.github.io\u002Faws-lambda-powertools-dotnet\u002F)) provides structured logging tools that enable you to set log levels that can be configured on a per environment basis. \n",[10],{"title":11,"collapsible":12,"isCollapsed":12,"content":13},"Top 8 Optimizations",false,[14,21,28,33,40,46,52,58],{"title":15,"order":16,"time":17,"path":18,"id":19,"link":20},"1. Fine-tune Lambda power",1,"4 min","1-fine-tuning","1-fine-tuning.md","\u002Fcontent\u002Fservice\u002Flambda\u002Fguides\u002Fcost-optimization\u002F1-fine-tuning",{"title":22,"order":23,"time":24,"path":25,"id":26,"link":27},"2. Switch to Graviton2",2,"2 min","2-graviton","2-graviton.md","\u002Fcontent\u002Fservice\u002Flambda\u002Fguides\u002Fcost-optimization\u002F2-graviton",{"title":6,"order":7,"time":29,"path":30,"id":31,"link":32},"1 min","3-cloudwatch","3-cloudwatch.md","\u002Fcontent\u002Fservice\u002Flambda\u002Fguides\u002Fcost-optimization\u002F3-cloudwatch",{"title":34,"order":35,"time":36,"path":37,"id":38,"link":39},"4. Don't pay for idle",4,"3 min","4-avoid-idle","4-avoid-idle.md","\u002Fcontent\u002Fservice\u002Flambda\u002Fguides\u002Fcost-optimization\u002F4-avoid-idle",{"title":41,"order":42,"time":17,"path":43,"id":44,"link":45},"5. Filter and batch events",5,"5-filter-and-batch","5-filter-and-batch.md","\u002Fcontent\u002Fservice\u002Flambda\u002Fguides\u002Fcost-optimization\u002F5-filter-and-batch",{"title":47,"order":48,"time":36,"path":49,"id":50,"link":51},"6. Set realistic timeouts",6,"6-set-timeouts","6-set-timeouts.md","\u002Fcontent\u002Fservice\u002Flambda\u002Fguides\u002Fcost-optimization\u002F6-set-timeouts",{"title":53,"order":54,"time":29,"path":55,"id":56,"link":57},"7. Use direct integrations",7,"7-direct-integrations","7-direct-integrations.md","\u002Fcontent\u002Fservice\u002Flambda\u002Fguides\u002Fcost-optimization\u002F7-direct-integrations",{"title":59,"order":60,"time":29,"path":61,"id":62,"link":63},"8. Use CloudWatch embedded metric format",8,"8-emf","8-emf.md","\u002Fcontent\u002Fservice\u002Flambda\u002Fguides\u002Fcost-optimization\u002F8-emf","LIST",[66,67,68,69,70],"content\u002Fcontributors\u002Fdan-fox.json","content\u002Fcontributors\u002Fanton-aleksandrov.json","content\u002Fcontributors\u002Fjosh-kahn.json","content\u002Fcontributors\u002Fdhiraj-mahapatro.json","content\u002Fcontributors\u002Fvamsi-vikash-ankam.json","Cost Optimization for AWS Lambda",1792665272193]