Skip to content

chore: Fix metrics lambda context and storage resolution #613

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

Merged

Conversation

hjgraca
Copy link
Contributor

@hjgraca hjgraca commented Jul 11, 2024

Please provide the issue number

Issue number: #612

Summary

WIth the new AOT release there was a problem at runtime with the serializaton of LambdaContext when capturing cold starts, the funcionname was not being set

There is also a issue with StorageResolution serialization not serializing to int instead is serializing the string "High"

Changes

  • Removed the dependency of reflection for LambdaContext and bring the Amazon.Lambda.Core.ILambdaContext to Metrics.
  • Add a new MetricResolutionJsonConverter to serialize StorageResolution correctly
  • Remove the custom serialization StringEnumConverter for MetricsUnit and add the default JsonStringEnumConverter

User experience

Please share what the user experience looks like before and after this change

Checklist

Please leave checklist items unchecked if they do not apply to your change.

Is this a breaking change?

RFC issue number:

Checklist:

  • Migration process documented
  • Implement warnings (if it can live side by side)

Acknowledgment

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.

hjgraca added 2 commits July 11, 2024 18:13
…ialization due to reflection (AOT). Create new converter and use the default one on strings only.
@auto-assign auto-assign bot requested review from amirkaws and sliedig July 11, 2024 17:38
@boring-cyborg boring-cyborg bot added area/metrics Core metrics utility tests labels Jul 11, 2024
@pull-request-size pull-request-size bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jul 11, 2024
@github-actions github-actions bot added the internal Maintenance changes label Jul 11, 2024
@hjgraca hjgraca added the aot label Jul 11, 2024
Copy link

codecov bot commented Jul 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 72.43%. Comparing base (33546b4) to head (7f4d676).

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #613      +/-   ##
===========================================
- Coverage    72.58%   72.43%   -0.15%     
===========================================
  Files          190      190              
  Lines         7900     7897       -3     
  Branches       850      852       +2     
===========================================
- Hits          5734     5720      -14     
- Misses        1876     1889      +13     
+ Partials       290      288       -2     
Flag Coverage Δ
unittests 72.43% <100.00%> (-0.15%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@leandrodamascena leandrodamascena self-requested a review July 11, 2024 17:49
Copy link
Contributor

@leandrodamascena leandrodamascena left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@hjgraca
Copy link
Contributor Author

hjgraca commented Jul 12, 2024

Not sure why is failing but codecov is green when going to the details

Copy link
Contributor

@amirkaws amirkaws left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@hjgraca hjgraca merged commit a1ae03a into aws-powertools:develop Jul 12, 2024
6 of 7 checks passed
@hjgraca hjgraca deleted the fix-metrics-resolution-context branch July 12, 2024 09:18
@hjgraca hjgraca mentioned this pull request Jul 12, 2024
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aot area/metrics Core metrics utility internal Maintenance changes size/L Denotes a PR that changes 100-499 lines, ignoring generated files. tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants