Skip to content

feat: Add Parameters Utility #167

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
merged 48 commits into from
May 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
b676ef5
add parameters feature
amirkaws Sep 21, 2022
76b6354
continue working on parameters feature
amirkaws Sep 22, 2022
0557b3f
continue working on parameters feature
amirkaws Sep 22, 2022
2791e7e
continue working on parameters feature
amirkaws Sep 22, 2022
bbba488
continue working on parameters feature
amirkaws Sep 22, 2022
ba35798
continue working on parameters feature
amirkaws Sep 26, 2022
fafd2db
continue working on parameters feature
amirkaws Sep 26, 2022
f3e0fba
continue working on parameters feature
amirkaws Sep 30, 2022
92e7f7f
continue working on parameters feature
amirkaws Oct 3, 2022
46bc23f
formattting & cleanup
amirkaws Oct 3, 2022
85b6fe6
continue working on parameters feature
amirkaws Oct 4, 2022
068db92
continue working on parameters feature
amirkaws Oct 5, 2022
5114c13
continue working on parameters feature
amirkaws Oct 5, 2022
24d4bb6
continue working on parameters feature
amirkaws Oct 7, 2022
8c8b7fe
continue working on parameters feature
amirkaws Oct 7, 2022
5ac0877
continue working on parameters feature
amirkaws Oct 11, 2022
9f86ec5
add transformation functionality to GetMultiple
amirkaws Oct 14, 2022
a7b11b0
Add TransformationException
amirkaws Oct 14, 2022
a3497b4
Add document readme
amirkaws Oct 14, 2022
82959bf
continue documentation
amirkaws Oct 16, 2022
6c2c7a2
add parameters utilities to the navigation menu
amirkaws Oct 16, 2022
e1b20cf
continue working on parameters feature
amirkaws Oct 16, 2022
81b33cc
continue working on parameters feature
amirkaws Oct 17, 2022
3cc28fb
continue working on parameters feature
amirkaws Oct 17, 2022
8df80a9
continue working on code documenation
amirkaws Oct 17, 2022
417c359
continue working on code documenation
amirkaws Oct 17, 2022
5cdf2d1
continue working on code documenation
amirkaws Oct 17, 2022
04ffb15
continue working on code documenation
amirkaws Oct 18, 2022
5cec486
continue working on code documenation
amirkaws Oct 18, 2022
2b3e57d
continue working on code documenation
amirkaws Oct 18, 2022
ece6b14
continue working on code documenation
amirkaws Oct 19, 2022
2b56d85
continue working on code documenation
amirkaws Oct 19, 2022
71eb12a
continue working on code documenation
amirkaws Oct 19, 2022
5d7849b
continue working on code documenation
amirkaws Oct 19, 2022
b7f0f01
continue working on code documenation
amirkaws Oct 19, 2022
1532a81
continue working on code documenation
amirkaws Oct 19, 2022
c811460
Merge branch 'awslabs:develop' into amirkaws-feature-parameters
amirkaws Jan 18, 2023
bc94f68
Merge branch 'awslabs:develop' into amirkaws-feature-parameters
amirkaws Mar 23, 2023
e39d0f7
make parameters more generic
amirkaws Mar 30, 2023
8f524e7
Merge branch 'awslabs:develop' into amirkaws-feature-parameters
amirkaws Apr 6, 2023
71ccb30
Merge branch 'awslabs:develop' into amirkaws-feature-parameters
amirkaws Apr 6, 2023
72b3362
Merge branch 'awslabs:develop' into amirkaws-feature-parameters
amirkaws Apr 14, 2023
8416d25
remove AppConfig implementation
amirkaws May 9, 2023
349a5d5
sync with develop
amirkaws May 9, 2023
8c9f41a
adress the review comments
amirkaws May 9, 2023
6eef6ce
docs: fixed formatting and updated content
sliedig May 11, 2023
bd3c4db
feat: add package readme
sliedig May 11, 2023
f02a712
Merge pull request #1 from sliedig/amirkaws-feature-parameters
amirkaws May 11, 2023
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: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# AWS Lambda Powertools for .NET

![aws provider](https://img.shields.io/badge/provider-AWS-orange?logo=amazon-aws&color=ff9900)
![aws provider](https://img.shields.io/badge/provider-AWS-orange?logo=amazon-aws&color=ff9900)
[![Build](https://github.com/awslabs/aws-lambda-powertools-dotnet/actions/workflows/build.yml/badge.svg?branch=develop)](https://github.com/awslabs/aws-lambda-powertools-dotnet/actions/workflows/build.yml)
[![Join our Discord](https://dcbadge.vercel.app/api/server/B8zZKbbyET)](https://discord.gg/B8zZKbbyET)

Expand All @@ -20,9 +20,11 @@ Lambda Powertools provides three core utilities:

* **[Tracing](https://awslabs.github.io/aws-lambda-powertools-dotnet/core/tracing/)** - provides a simple way to send traces from functions to AWS X-Ray to provide visibility into function calls, interactions with other AWS services, or external HTTP requests. Annotations can easily be added to traces to allow filtering traces based on key information. For example, when using Tracer, a ColdStart annotation is created for you so you can easily group and analyze traces where there was an initialization overhead.

* **[Parameters (developer preview)](https://awslabs.github.io/aws-lambda-powertools-dotnet/core/parameters/)** - provides high-level functionality to retrieve one or multiple parameter values from [AWS Systems Manager Parameter Store](https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-parameter-store.html){target="_blank"}, [AWS Secrets Manager](https://aws.amazon.com/secrets-manager/){target="_blank"}, or [Amazon DynamoDB](https://aws.amazon.com/dynamodb/){target="_blank"}. We also provide extensibility to bring your own providers.

### Installation

The AWS Lambda Powertools for .NET utilities (.NET 6) are available as NuGet packages. You can install the packages from the NuGet gallery or from within the Visual Studio IDE. Search `AWS.Lambda.Powertools*` to see various utilities available. Powertools is available on NuGet.
The AWS Lambda Powertools for .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*){target="_blank"} 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 All @@ -36,6 +38,10 @@ The AWS Lambda Powertools for .NET utilities (.NET 6) are available as NuGet pac

`dotnet add package AWS.Lambda.Powertools.Tracing`

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

`dotnet add package AWS.Lambda.Powertools.AWS.Lambda.Powertools.Parameters`

## 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.
Expand Down Expand Up @@ -66,7 +72,7 @@ We welcome contributions from developers of all levels to our open-source projec
## Connect

* **AWS Lambda Powertools on Discord**: `#dotnet` - **[Invite link](https://discord.gg/B8zZKbbyET)**
* **Email**: aws-lambda-powertools-feedback@amazon.com
* **Email**: <aws-lambda-powertools-feedback@amazon.com>

## License

Expand Down
8 changes: 8 additions & 0 deletions docs/core/logging.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ The logging utility provides a Lambda optimized logger with output structured as
* Log sampling enables DEBUG log level for a percentage of requests (disabled by default)
* Append additional keys to structured log at any point in time

## Installation

Powertools are available as NuGet packages. You can install the packages from [NuGet Gallery](https://www.nuget.org/packages?q=AWS+Lambda+Powertools*){target="_blank"} 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):

`dotnet add package AWS.Lambda.Powertools.Logging`

## Getting started

Logging requires two settings:
Expand Down
28 changes: 27 additions & 1 deletion docs/core/metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ These metrics can be visualized through [Amazon CloudWatch Console](https://aws.

## Key features

* Aggregate up to 100 metrics using a single CloudWatch EMF object (large JSON blob)
* Aggregate up to 100 metrics using a single [CloudWatch EMF](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Embedded_Metric_Format_Specification.html){target="_blank"} object (large JSON blob)
* Validating your metrics against common metric definitions mistakes (for example, metric unit, values, max dimensions, max metrics)
* Metrics are created asynchronously by the CloudWatch service. You do not need any custom stacks, and there is no impact to Lambda function latency
* Context manager to create a one off metric with a different dimension
Expand All @@ -21,6 +21,14 @@ These metrics can be visualized through [Amazon CloudWatch Console](https://aws.
<figcaption>Metrics showcase - Metrics Explorer</figcaption>
</figure>

## Installation

Powertools are available as NuGet packages. You can install the packages from [NuGet Gallery](https://www.nuget.org/packages?q=AWS+Lambda+Powertools*){target="_blank"} or from Visual Studio editor by searching `AWS.Lambda.Powertools*` to see various utilities available.

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

`dotnet nuget add AWS.Lambda.Powertools.Metrics`

## Terminologies

If you're new to Amazon CloudWatch, there are two terminologies you must be aware of before using this utility:
Expand Down Expand Up @@ -378,3 +386,21 @@ CloudWatch EMF uses the same dimensions across all your metrics. Use **`PushSing
});
...
```

## Testing your code

### Environment variables

???+ tip
Ignore this section, if:

* You are explicitly setting namespace/default dimension via `namespace` and `service` parameters
* You're not instantiating `Metrics` in the global namespace

For example, `Metrics(namespace="ExampleApplication", service="booking")`

Make sure to set `POWERTOOLS_METRICS_NAMESPACE` and `POWERTOOLS_SERVICE_NAME` before running your tests to prevent failing on `SchemaValidation` exception. You can set it before you run tests by adding the environment variable.

```csharp title="Injecting Metric Namespace before running tests"
Environment.SetEnvironmentVariable("POWERTOOLS_METRICS_NAMESPACE","AWSLambdaPowertools");
```
10 changes: 9 additions & 1 deletion docs/core/tracing.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,20 @@ a provides functionality to reduce the overhead of performing common tracing tas

## Key Features

* Helper methods to improve the developer experience for creating [custom AWS X-Ray subsegments](https://docs.aws.amazon.com/xray/latest/devguide/xray-sdk-dotnet-subsegments.html).
* Helper methods to improve the developer experience for creating [custom AWS X-Ray subsegments](https://docs.aws.amazon.com/xray/latest/devguide/xray-sdk-dotnet-subsegments.html){target=blank}.
* Capture cold start as annotation.
* Capture function responses and full exceptions as metadata.
* Better experience when developing with multiple threads.
* Auto-patch supported modules by AWS X-Ray

## Installation

Powertools are available as NuGet packages. You can install the packages from [NuGet Gallery](https://www.nuget.org/packages?q=AWS+Lambda+Powertools*){target="_blank"} or from Visual Studio editor by searching `AWS.Lambda.Powertools*` to see various utilities available.

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

`dotnet nuget add AWS.Lambda.Powertools.Tracing`

## Getting Started

Before you use this utility, your AWS Lambda function [must have permissions](https://docs.aws.amazon.com/lambda/latest/dg/services-xray.html#services-xray-permissions) to send traces to AWS X-Ray.
Expand Down
Loading