Skip to content

chore: AOT support for Logging and Metrics #557

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

Closed
wants to merge 107 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
107 commits
Select commit Hold shift + click to select a range
6196292
Update batch examples
hjgraca Feb 17, 2024
21ea1f4
Update idempotency
hjgraca Feb 17, 2024
7381be5
Update Logging
hjgraca Feb 17, 2024
2c18aec
Update Metrics
hjgraca Feb 17, 2024
726033d
Update HelloWorld.csproj
hjgraca Feb 17, 2024
ba11561
Update Api example
hjgraca Feb 17, 2024
3ffc139
Update HelloWorld.csproj
hjgraca Feb 17, 2024
db8bac8
first try to AOT for Logging
hjgraca Feb 17, 2024
a484b78
update AOT tests
hjgraca Feb 19, 2024
a0f0494
merge commit
hjgraca Feb 19, 2024
855d55c
metrics serialization support for AOT
hjgraca Feb 19, 2024
6c7558b
add tracing to AOT tests. Remove JsonConverter from MetricResolution.cs
hjgraca Feb 21, 2024
cc264ef
fix JsonSerializerOptions instances cannot be modified.
hjgraca Feb 21, 2024
3a9ec17
Moving source generators behind #if NET8_0_OR_GREATER. Add XML commen…
hjgraca Feb 21, 2024
1a9e11d
add AppConfig provider
amirkaws Feb 28, 2024
b538e1e
add AppConfig provider documentation
amirkaws Feb 28, 2024
4593f42
add feature flags helper methods
amirkaws Feb 29, 2024
433a059
add feature flags unit tests
amirkaws Mar 1, 2024
070f907
add feature flags unit tests clean up
amirkaws Mar 1, 2024
215aeeb
update documentation
amirkaws Mar 1, 2024
5b078ed
update documentation
amirkaws Mar 1, 2024
fa76593
Merge pull request #559 from amirkaws/add-configuration-parameter-pro…
hjgraca Mar 5, 2024
51efd60
Merge pull request #555 from aws-powertools/hjgraca-update-examples-185
hjgraca Mar 5, 2024
12be37a
update nuget versions
amirkaws Mar 8, 2024
eb3cfc1
Merge pull request #561 from amirkaws/update-nuget-versions
hjgraca Mar 8, 2024
6a866f4
update package versions for release 1.9.0
amirkaws Mar 8, 2024
9148d02
Merge pull request #563 from amirkaws/release-version-1.9.0
hjgraca Mar 8, 2024
e4e8179
update package versions for examples
amirkaws Mar 8, 2024
ac03a89
Add check for null property value
Mar 8, 2024
3b4b4b6
Merge pull request #564 from amirkaws/update-nuget-versions-for-examples
hjgraca Mar 10, 2024
a0e07fc
Update HelloWorld.Tests.csproj
hjgraca Mar 10, 2024
7617ec7
Update FunctionTest.cs
hjgraca Mar 10, 2024
2ebdc8b
Update HelloWorld.Tests.csproj
hjgraca Mar 10, 2024
9551733
Update FunctionTest.cs
hjgraca Mar 10, 2024
92a9ce8
Update FunctionTest.cs
hjgraca Mar 10, 2024
be54168
Update HelloWorld.Tests.csproj
hjgraca Mar 10, 2024
3aaf67d
Update HelloWorld.csproj
hjgraca Mar 10, 2024
6263ec9
Merge pull request #1 from momo333/aot-support
hjgraca Mar 10, 2024
87b27da
update api docs build workflow
hjgraca Mar 10, 2024
9288404
Merge pull request #565 from aws-powertools/update-nuget-examples
amirkaws Mar 11, 2024
b348667
Update index to add supported runtimes
hjgraca Mar 13, 2024
cf31888
Update README.md
hjgraca Mar 13, 2024
b2c6988
Update badges
hjgraca Mar 13, 2024
02db37e
Merge pull request #569 from aws-powertools/hjgraca-update-docs-dotnet8
amirkaws Mar 15, 2024
bdb02b7
GetMethodHandler: replace method parameter with target.Method paramet…
hjgraca Mar 20, 2024
15efb4c
Merge pull request #572 from hjgraca/fix-tracing-duplicate-generic-me…
hjgraca Mar 20, 2024
a2d6aaa
Update version for release
hjgraca Mar 21, 2024
ff53f97
Merge pull request #575 from aws-powertools/release-191
amirkaws Mar 21, 2024
91c250e
merge with upstream
hjgraca Mar 21, 2024
01a18e9
Remove JmesPath external dependency. Update Idempotency to use new in…
hjgraca Apr 17, 2024
93ede40
cleanup, refactoring and tests
hjgraca Apr 17, 2024
4170aba
Add README.md. More tests, examples and events.
hjgraca Apr 18, 2024
0055589
mkdocs update to move sidebar to the right and year update
hjgraca Apr 18, 2024
5e8ba98
update examples nuget packages
hjgraca Apr 18, 2024
568caa4
update jmespath readme
hjgraca Apr 18, 2024
6953ee1
Add documentation and update README.md
hjgraca Apr 18, 2024
1e9808c
Add project properties. Prevent JMESPath project to add Common project.
hjgraca Apr 18, 2024
bdc5cbf
Tackle SonarCloud raised issues
hjgraca Apr 18, 2024
4b5c6fd
more Sonar fixes
hjgraca Apr 18, 2024
5927c52
more sonarcloud
hjgraca Apr 18, 2024
11202d4
sonarcloud fixes
hjgraca Apr 18, 2024
ce881d4
Add continue-on-error to build workflow. very flaky service
hjgraca Apr 19, 2024
333d4b1
more sonar fixes
hjgraca Apr 19, 2024
418386e
sonar fixes
hjgraca Apr 19, 2024
b39a1c4
sonar fixes
hjgraca Apr 19, 2024
e353d7d
remove unused files
hjgraca Apr 19, 2024
4678224
sonar fixes
hjgraca Apr 19, 2024
910e859
sonar fixes
hjgraca Apr 19, 2024
0c92aae
sonar fixes and refactor
hjgraca Apr 19, 2024
942aaa9
refactor. include license text, remove duplication to make sonar happy
hjgraca Apr 19, 2024
ea6b795
refactor values
hjgraca Apr 19, 2024
83560af
Add comments to code. Refactor Expressions and Operators
hjgraca Apr 22, 2024
6af56d9
Update Attribution - update LICENSE-THIRD-PARTY
hjgraca May 2, 2024
930c326
rename THIRD-PARTY-LICENSES
hjgraca May 2, 2024
11827dc
remove unused operator
hjgraca May 6, 2024
4a15617
move slice to expressions
hjgraca May 6, 2024
7afd6ab
merge
hjgraca May 7, 2024
b1f53c5
docs: add link to Powertools for AWS Lambda workshop
dreamorosi May 7, 2024
18df0fd
Merge pull request #581 from dreamorosi/docs/link_workshop
hjgraca May 7, 2024
8ab564f
Update build pipeline
hjgraca May 8, 2024
a8f4f4f
Update build.yml
hjgraca May 8, 2024
bf85ba9
add permissions
hjgraca May 8, 2024
5f2078d
add token env
hjgraca May 8, 2024
5bc87a0
Merge pull request #584 from aws-powertools/hjgraca-build-pipeline
hjgraca May 9, 2024
0560aa0
add targetframework condition to error on specific warnings
hjgraca May 9, 2024
f383c83
merge
hjgraca May 9, 2024
c744870
adressing pr comments
hjgraca May 9, 2024
c75e834
merge
hjgraca May 9, 2024
4e6681f
Merge pull request #578 from hjgraca/feature/jmespath-powertools
hjgraca May 9, 2024
a455fa8
Update idempotency version for release 1.10.0
hjgraca May 9, 2024
7a10387
Merge pull request #586 from aws-powertools/hjgraca-version-release-1-10
hjgraca May 9, 2024
af850da
Update idempotency examples for release 1..10.0
hjgraca May 9, 2024
0a6ab62
fix Idempotency jmespath dependency missing
hjgraca May 9, 2024
e519340
remove version
hjgraca May 9, 2024
b7f5ee9
update version
hjgraca May 9, 2024
16667a0
add build target to copy files to idempotency
hjgraca May 9, 2024
1d227a8
Merge pull request #590 from hjgraca/fix-jmespath-dep
hjgraca May 9, 2024
e07c64d
Update examples idempotency
hjgraca May 9, 2024
0cdab3f
Merge pull request #589 from aws-powertools/hjgraca-idempotency-examples
hjgraca May 10, 2024
72b98d8
merge
hjgraca May 10, 2024
44ae98f
add thread safety test. AddMetric lock.
hjgraca May 20, 2024
ab95e85
remove unused
hjgraca May 20, 2024
47227ad
Merge pull request #594 from hjgraca/metrics-thread-safety-bug
hjgraca May 21, 2024
a522ea9
Update version for release 1.10.1
hjgraca May 21, 2024
dfd31d4
Merge pull request #596 from aws-powertools/hjgraca-update-version-1.…
hjgraca May 22, 2024
5b45841
merge
hjgraca May 23, 2024
ce3e407
remove warnings as errors for now
hjgraca Jun 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,17 @@ defaults:
run:
working-directory: ./libraries

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Setup .NET 6.0 & 8.0
uses: actions/setup-dotnet@607fce577a46308457984d59e4954e075820f10a
uses: actions/setup-dotnet@4d6c8fcf3c8f7a60068d26b594648e99df24cee3 # 4.0.0
with:
dotnet-version: |
6.0.405
Expand All @@ -29,11 +32,12 @@ jobs:
- name: Test & Code Coverage
run: dotnet test --collect:"XPlat Code Coverage" --results-directory ./codecov --verbosity normal
- name: Codecov
uses: codecov/codecov-action@81cd2dc8148241f03f5839d295e000b8f761e378 # 3.1.0
uses: codecov/codecov-action@5ecb98a3c6b747ed38dc09f787459979aebb39be # 4.3.1
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: unittests
fail_ci_if_error: true
fail_ci_if_error: false
name: codecov-lambda-powertools-dotnet
verbose: true
directory: ./libraries/codecov
10 changes: 6 additions & 4 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,12 @@ jobs:
uses: actions/setup-dotnet@607fce577a46308457984d59e4954e075820f10a
with:
dotnet-version: 6.0.405
- uses: nikeee/docfx-action@b9c2cf92e3b4aa06878a1410833a8828b4bdcd26 #1.0.0
name: Build Documentation
with:
args: apidocs/docfx.json

- name: Build Api Docs
run: |
dotnet tool install -g docfx
docfx apidocs/docfx.json

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@e1e17a757e536f70e52b5a12b2e8d1d1c60e04ef
with:
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
![aws provider](https://img.shields.io/badge/provider-AWS-orange?logo=amazon-aws&color=ff9900)
[![Build](https://github.com/aws-powertools/powertools-lambda-dotnet/actions/workflows/build.yml/badge.svg?branch=develop)](https://github.com/aws-powertools/powertools-lambda-dotnet/actions/workflows/build.yml)
[![codecov.io](https://codecov.io/github/aws-powertools/powertools-lambda-dotnet/branch/develop/graphs/badge.svg)](https://app.codecov.io/gh/aws-powertools/powertools-lambda-dotnet)
[![dotnet support](https://img.shields.io/static/v1?label=dotnet&message=%20NET6.0&color=blue?style=flat-square&logo=dotnet)](https://dotnet.microsoft.com/en-us/download/dotnet/6.0)
[![dotnet support](https://img.shields.io/static/v1?label=dotnet&message=%20NET6.0|NET8.0&color=blue?style=flat-square&logo=dotnet)](https://dotnet.microsoft.com/en-us/download/dotnet/6.0)
[![NuGet Downloads](https://img.shields.io/nuget/dt/AWS.Lambda.Powertools.Logging.svg)](https://www.nuget.org/packages?q=AWS.Lambda.Powertools)
[![Join our Discord](https://dcbadge.vercel.app/api/server/B8zZKbbyET)](https://discord.gg/B8zZKbbyET)
[![Join our Discord](https://dcbadge.vercel.app/api/server/B8zZKbbyET?style=flat-square)](https://discord.gg/B8zZKbbyET)

Powertools for AWS Lambda (.NET) is a developer toolkit to implement Serverless [best practices and increase developer velocity](https://docs.powertools.aws.dev/lambda-dotnet/#features).

Expand Down Expand Up @@ -33,7 +33,7 @@ Powertools for AWS Lambda (.NET) provides three core utilities:

### Installation

The Powertools for AWS Lambda (.NET) utilities (.NET 6) are available as NuGet packages. You can install the packages from [NuGet Gallery](https://www.nuget.org/packages?q=AWS+Lambda+Powertools*) or from Visual Studio editor by searching `AWS.Lambda.Powertools*` to see various utilities available.
The Powertools for AWS Lambda (.NET) utilities (.NET 6 and .NET 8) are available as NuGet packages. You can install the packages from [NuGet Gallery](https://www.nuget.org/packages?q=AWS+Lambda+Powertools*) or from Visual Studio editor by searching `AWS.Lambda.Powertools*` to see various utilities available.

* [AWS.Lambda.Powertools.Logging](https://www.nuget.org/packages?q=AWS.Lambda.Powertools.Logging):

Expand Down Expand Up @@ -61,7 +61,7 @@ The Powertools for AWS Lambda (.NET) utilities (.NET 6) are available as NuGet p

## Examples

We have provided examples focused specifically on each of the utilities. Each solution comes with an AWS Serverless Application Model (AWS SAM) templates to run your functions as a Zip package using the AWS Lambda .NET 6 managed runtime; or as a container package using the AWS base images for .NET.
We have provided examples focused specifically on each of the utilities. Each solution comes with an AWS Serverless Application Model (AWS SAM) templates to run your functions as a Zip package using the AWS Lambda .NET 6 or .NET 8 managed runtime; or as a container package using the AWS base images for .NET.

* **[Logging example](examples/Logging/)**
* **[Metrics example](examples/Metrics/)**
Expand Down
201 changes: 200 additions & 1 deletion LICENSE-THIRD-PARTY → THIRD-PARTY-LICENSES
Original file line number Diff line number Diff line change
Expand Up @@ -202,4 +202,203 @@ Apache License
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
limitations under the License.


--------------------------------------------------------------------------------

danielaparker/JsonCons.Net
v1.1.0 <https://github.com/danielaparker/JsonCons.Net>

Apache License
Version 2.0, January 2004
https://www.apache.org/licenses/

TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

1. Definitions.

"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.

"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.

"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.

"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.

"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.

"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.

"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).

"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.

"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."

"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.

2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.

3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.

4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:

(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and

(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and

(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and

(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.

You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.

5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.

6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.

7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.

8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.

9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.

END OF TERMS AND CONDITIONS

Copyright 2013-2018 Docker, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.


5 changes: 4 additions & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ description: Powertools for AWS Lambda (.NET)

# Powertools for AWS Lambda (.NET)

Powertools for AWS Lambda (.NET) (which from here will be referred as Powertools) is a suite of utilities for [AWS Lambda](https://aws.amazon.com/lambda/) functions to ease adopting best practices such as tracing, structured logging, custom metrics, and more. Please note, **Powertools for AWS Lambda (.NET) is optimized for .NET 6+**.
Powertools for AWS Lambda (.NET) (which from here will be referred as Powertools) is a suite of utilities for [AWS Lambda](https://aws.amazon.com/lambda/) functions to ease adopting best practices such as tracing, structured logging, custom metrics, and more.

!!! info
**Supports .NET 6 and .NET 8 runtimes**

???+ tip
Powertools is also available for [Python](https://docs.powertools.aws.dev/lambda/python/){target="_blank"}, [Java](https://docs.powertools.aws.dev/lambda/java/){target="_blank"}, and [TypeScript](https://docs.powertools.aws.dev/lambda/typescript/latest/){target="_blank"}.
Expand Down
Loading
Loading