winglang / wing

A programming language for the cloud ☁️ A unified programming model, combining infrastructure and runtime code into one language ⚡
https://winglang.io
Other
4.73k stars 185 forks source link

chore(sdk): switch function log format from `text` to `JSON` for AWS platforms #5955

Open garysassano opened 3 months ago

garysassano commented 3 months ago

A best practice when authoring Lambda functions is to use the Powertools for AWS Lambda Logger, which allows to emit structured logs in JSON format. However, even if you choose not to use Powertools, you can still take advantage of the JSON format to make navigating through your functions' logs much easier. This is true especially for the system logs, over which you have no direct control.

By submitting this pull request, I confirm that my contribution is made under the terms of the Wing Cloud Contribution License.

github-actions[bot] commented 3 months ago

Thanks for opening this pull request! :tada: Please consult the contributing guidelines for details on how to contribute to this project. If you need any assistence, don't hesitate to ping the relevant owner over Discord.

Topic Owner
Wing SDK and utility APIs @chriscbr
Wing Console @ainvoner, @skyrpex, @polamoros
JSON, structs, primitives and collections @hasanaburayyan
Platforms and plugins @hasanaburayyan
Frontend resources (website, react, etc) @tsuf239
Language design @eladb
VSCode extension and language server @markmcculloh
Compiler architecture, inflights, lifting @yoav-steinberg
Wing Testing Framework @tsuf239
Wing CLI @markmcculloh
Build system, dev environment, releases @markmcculloh
Library Ecosystem @chriscbr
Documentation @hasanaburayyan
SDK test suite @tsuf239
Examples @hasanaburayyan
Wing Playground @eladcon
monadabot commented 3 months ago

Console preview environment is available at https://wing-console-pr-5955.fly.dev :rocket:

Last Updated (UTC) 2024-05-30 18:41
monadabot commented 3 months ago

Benchmarks

Comparison to Baseline ⬜⬜⬜⬜⬜🟥⬜⬜⬜⬜⬜⬜⬜ | Benchmark | Before | After | Change | | :-- | --: | --: | --: | | version | 59ms±0.65 | 60ms±0.86 | +0ms (+0.25%)⬜ | | functions_10.test.w -t sim | 520ms±29.76 | 508ms±9.07 | -12ms (-2.32%)⬜ | | functions_10.test.w -t tf-aws | 2071ms±18.18 | 2073ms±30.38 | +2ms (+0.1%)⬜ | | hello_world.test.w -t sim | 411ms±3.96 | 407ms±4.48 | -4ms (-0.98%)⬜ | | hello_world.test.w -t tf-aws | 1442ms±5.68 | 1463ms±10.72 | +22ms (+1.5%)⬜ | | functions_1.test.w -t sim | 404ms±4.87 | 418ms±5.02 | +14ms (+3.36%)🟥 | | functions_1.test.w -t tf-aws | 826ms±5.44 | 839ms±7.35 | +13ms (+1.54%)⬜ | | jsii_big.test.w -t sim | 2808ms±17.97 | 2839ms±15.24 | +31ms (+1.1%)⬜ | | jsii_big.test.w -t tf-aws | 3046ms±23.5 | 3041ms±15.11 | -5ms (-0.16%)⬜ | | empty.test.w -t sim | 368ms±6.16 | 368ms±3.99 | 0ms (-0.04%)⬜ | | empty.test.w -t tf-aws | 604ms±6.53 | 610ms±3.71 | +6ms (+0.95%)⬜ | | jsii_small.test.w -t sim | 378ms±3.75 | 377ms±3.71 | 0ms (-0.02%)⬜ | | jsii_small.test.w -t tf-aws | 621ms±4.44 | 622ms±4.02 | +1ms (+0.11%)⬜ | ⬜ Within 1.5 standard deviations 🟩 Faster, Above 1.5 standard deviations 🟥 Slower, Above 1.5 standard deviations _Benchmarks may vary outside of normal expectations, especially when running in GitHub Actions CI._
Results |name|mean|min|max|moe|sd| |----|----|----|----|----|----| |version|60ms|58ms|61ms|1ms|1ms| |functions_10.test.w -t sim|508ms|484ms|525ms|9ms|13ms| |functions_10.test.w -t tf-aws|2073ms|2025ms|2170ms|30ms|42ms| |hello_world.test.w -t sim|407ms|393ms|414ms|4ms|6ms| |hello_world.test.w -t tf-aws|1463ms|1440ms|1486ms|11ms|15ms| |functions_1.test.w -t sim|418ms|408ms|431ms|5ms|7ms| |functions_1.test.w -t tf-aws|839ms|820ms|856ms|7ms|10ms| |jsii_big.test.w -t sim|2839ms|2811ms|2873ms|15ms|21ms| |jsii_big.test.w -t tf-aws|3041ms|3015ms|3071ms|15ms|21ms| |empty.test.w -t sim|368ms|362ms|377ms|4ms|6ms| |empty.test.w -t tf-aws|610ms|603ms|618ms|4ms|5ms| |jsii_small.test.w -t sim|377ms|370ms|387ms|4ms|5ms| |jsii_small.test.w -t tf-aws|622ms|613ms|630ms|4ms|6ms|
Last Updated (UTC) 2024-05-21 19:08
tsuf239 commented 3 months ago

@Chriscbr what do you think?

Chriscbr commented 3 months ago

It sounds handy, let's try it 👍

tsuf239 commented 2 months ago

Hi @garysassano, Can you please resolve the conflicts? (you can accept incoming changes, and let the PR actions fix them)

tsuf239 commented 2 months ago

I started an automated test on aws here

tsuf239 commented 2 months ago

The automated aws tests are failing: https://github.com/winglang/wing/pull/5955#issuecomment-2016814275 I'm not sure, but it seems like this PR caused it indirectly- and that a fix is needed at our end @MarkMcCulloh what do you think?

github-actions[bot] commented 2 months ago

Hi,

This PR has not seen activity in 20 days. Therefore, we are marking the PR as stale for now. It will be closed after 7 days. If you need help with the PR, do not hesitate to reach out in the winglang community discord at winglang.discord.com. Feel free to re-open this PR when it is still relevant and ready to be worked on again. Thanks!

tsuf239 commented 2 months ago

Hi @garysassano, can you please update from main?

monadabot commented 2 months ago

:x: Unstable Self-Mutation :x:

Self-mutation has run twice in a row. There may be a something non-deterministic in the build or test process. Check the last mutation commit (ec85f99b0609a79e12b24080740b450dedfffe3b) for suspicious changes. This is typically caused by:

tsuf239 commented 1 month ago

@garysassano math doesn't seem to work on AWS, can you please check? https://github.com/winglang/wing/actions/runs/8866141232/job/24343706916 (also, it doesn't pass mutation)

garysassano commented 1 month ago

I opened issue #6363, it should be fine once it gets fixed.

tsuf239 commented 1 month ago

Sdk spec tests are successful on tf-aws! 🤩

it can be merged as soon as you'll fix the pr action