Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 25 commits into
base: main
Choose a base branch
from

Conversation

garysassano
Copy link
Collaborator

@garysassano garysassano commented Mar 16, 2024

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.

@garysassano garysassano requested a review from a team as a code owner March 16, 2024 09:41
Copy link

github-actions bot commented Mar 16, 2024

Thanks for opening this pull request! 🎉
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
Copy link
Contributor

monadabot commented Mar 16, 2024

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

Last Updated (UTC) 2024-05-21 19:13

@monadabot
Copy link
Contributor

monadabot commented Mar 16, 2024

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

monadabot and others added 4 commits March 16, 2024 05:52
Signed-off-by: monada-bot[bot] <monabot@monada.co>
Signed-off-by: monada-bot[bot] <monabot@monada.co>
Signed-off-by: monada-bot[bot] <monabot@monada.co>
@monadabot monadabot added the ⚠️ pr/review-mutation PR has been mutated and will not auto-merge. Clear this label if the changes look good! label Mar 16, 2024
@tsuf239
Copy link
Collaborator

tsuf239 commented Mar 18, 2024

@Chriscbr what do you think?

@Chriscbr
Copy link
Contributor

It sounds handy, let's try it 👍

@tsuf239 tsuf239 removed the ⚠️ pr/review-mutation PR has been mutated and will not auto-merge. Clear this label if the changes look good! label Mar 24, 2024
@tsuf239
Copy link
Collaborator

tsuf239 commented Mar 24, 2024

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

@tsuf239
Copy link
Collaborator

tsuf239 commented Mar 24, 2024

I started an automated test on aws here

monadabot and others added 3 commits March 24, 2024 09:47
Signed-off-by: monada-bot[bot] <monabot@monada.co>
Signed-off-by: monada-bot[bot] <monabot@monada.co>
@monadabot monadabot added the ⚠️ pr/review-mutation PR has been mutated and will not auto-merge. Clear this label if the changes look good! label Mar 24, 2024
@tsuf239 tsuf239 added the 🚧 pr/do-not-merge PRs with this label will not be automatically merged by mergify. label Mar 24, 2024
@tsuf239
Copy link
Collaborator

tsuf239 commented Mar 24, 2024

The automated aws tests are failing: #5955 (comment)
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?

Copy link

github-actions bot commented Apr 14, 2024

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
Copy link
Collaborator

tsuf239 commented Apr 17, 2024

Hi @garysassano, can you please update from main?

Signed-off-by: monada-bot[bot] <monabot@monada.co>
@monadabot
Copy link
Contributor

❌ Unstable Self-Mutation ❌

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 (ec85f99) for suspicious changes.
This is typically caused by:

  • Absolute paths
  • Timestamps
  • Random values
  • Flakey tests (relying on one of the above)

@tsuf239
Copy link
Collaborator

tsuf239 commented Apr 28, 2024

@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
Copy link
Collaborator Author

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

@tsuf239
Copy link
Collaborator

tsuf239 commented May 15, 2024

Sdk spec tests are successful on tf-aws!
🤩

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

@tsuf239 tsuf239 removed 🚧 pr/do-not-merge PRs with this label will not be automatically merged by mergify. ⚠️ pr/review-mutation PR has been mutated and will not auto-merge. Clear this label if the changes look good! labels May 15, 2024
@monadabot monadabot added the ⚠️ pr/review-mutation PR has been mutated and will not auto-merge. Clear this label if the changes look good! label May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⚠️ pr/review-mutation PR has been mutated and will not auto-merge. Clear this label if the changes look good!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants