From b2698791aad3735e8c83771a6a0a030adfe73d3c Mon Sep 17 00:00:00 2001 From: Stephen Liedig Date: Tue, 11 Jan 2022 17:00:21 +0800 Subject: [PATCH 1/4] feat: updated docs theme --- mkdocs.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/mkdocs.yml b/mkdocs.yml index bf554856..03748f9d 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -6,6 +6,8 @@ edit_uri: edit/develop/docs nav: - Homepage: index.md + - Our tenets: tenets.md + - References: references.md - Changelog: changelog.md - Roadmap: https://github.com/awslabs/aws-lambda-powertools-roadmap/projects/1" target="_blank - Core utilities: @@ -15,15 +17,16 @@ nav: theme: name: material - palette: + palette: - scheme: default - primary: deep blue + primary: blue + accent: deep orange toggle: icon: material/toggle-switch-off-outline name: Switch to dark mode - scheme: slate - primary: indigo - accent: teal + primary: blue + accent: orange toggle: icon: material/toggle-switch name: Switch to light mode From 44eb09e5b48511488e60fb9a93703025bff6c8e8 Mon Sep 17 00:00:00 2001 From: Stephen Liedig Date: Tue, 11 Jan 2022 17:01:34 +0800 Subject: [PATCH 2/4] feat: update docs for homepage --- docs/index.md | 102 +++++++++++++++++++++++++++++---------------- docs/references.md | 24 +++++++++++ docs/tenets.md | 13 ++++++ 3 files changed, 102 insertions(+), 37 deletions(-) create mode 100644 docs/references.md create mode 100644 docs/tenets.md diff --git a/docs/index.md b/docs/index.md index 692746ca..69263bff 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,56 +1,84 @@ --- -title: Homepage -description: AWS Lambda Powertools for .NET +title: AWS Lambda Powertools for .NET (developer preview) +description: AWS Lambda Powertools for .NET (developer preview) --- -A suite of utilities for AWS Lambda functions to ease adopting best practices such as tracing, structured logging, custom metrics, and more. +# AWS Lambda Powertools for .NET -!!! tip "Looking for a quick read through how the core features are used?" - Check out [this detailed blog post](https://aws.amazon.com/blogs/opensource/simplifying-serverless-best-practices-with-lambda-powertools/) with a practical example. +AWS Lambda Powertools for .NET 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 .NET is optimised for .NET 6 only**. -## Tenets +The GitHub repository for this project can be found [here](https://github.com/awslabs/aws-lambda-powertools-dotnet). -This project separates core utilities that will be available in other runtimes vs general utilities that might not be available across all runtimes. +!!! warning "Do not use this library in production" -* **AWS Lambda only**. We optimise for AWS Lambda function environments and supported runtimes only. Utilities might work with web frameworks and non-Lambda environments, though they are not officially supported. -* **Eases the adoption of best practices**. The main priority of the utilities is to facilitate best practices adoption, as defined in the AWS Well-Architected Serverless Lens; all other functionality is optional. -* **Keep it lean**. Additional dependencies are carefully considered for security and ease of maintenance, and prevent negatively impacting startup time. -* **We strive for backwards compatibility**. New features and changes should keep backwards compatibility. If a breaking change cannot be avoided, the deprecation and migration process should be clearly defined. -* **We work backwards from the community**. We aim to strike a balance of what would work best for 80% of customers. Emerging practices are considered and discussed via Requests for Comment (RFCs) -* **Idiomatic**. Utilities follow programming language idioms and language-specific best practices. + **AWS Lambda Powertools for .NET is currently released as a alpha developer preview** and is intended strictly for feedback purposes only. This version is not stable, and significant breaking changes might incur as part of the upcoming production-ready release. + + Your support is much appreciated. If you encounter any problems, [please raise an issue](https://github.com/awslabs/aws-lambda-powertools-dotnet/issues/new/choose). + + **Do not use this library for production workloads.** + +## Available Powertools libraries + +| Utility | Description +| ------------------------------------------------- | --------------------------------------------------------------------------------- +[Tracing](./core/tracing.md) | Decorators and utilities to trace Lambda function handlers, and both synchronous and asynchronous functions +[Logger](./core/logging.md) | Structured logging made easier, and decorator to enrich structured logging with key Lambda context details +[Metrics](./core/metrics.md) | Custom AWS metrics created asynchronously via CloudWatch Embedded Metric Format (EMF) + +!!! info "Looking for a quick read through how the core features are used?" + Check out the [Simplifying serverless best practices with Lambda Powertools](https://aws.amazon.com/blogs/opensource/simplifying-serverless-best-practices-with-lambda-powertools/) blog post with a practical example. ## Install Powertools is available on NuGet. -* [AWS.Lambda.Powertools](https://www.nuget.org/packages?q=AWS.Lambda.Powertools): `dotnet nuget add AWS.Lambda.Powertools` +* [AWS.Lambda.Powertools.Tracing](https://www.nuget.org/packages?q=AWS.Lambda.Powertools.Tracing): + + `dotnet nuget add AWS.Lambda.Powertools.Tracing` + +* [AWS.Lambda.Powertools.Logging](https://www.nuget.org/packages?q=AWS.Lambda.Powertools.Logging): + + `dotnet nuget add AWS.Lambda.Powertools.Logging` + +* [AWS.Lambda.Powertools.Metrics](https://www.nuget.org/packages?q=AWS.Lambda.Powertools.Metrics): + + `dotnet nuget add AWS.Lambda.Powertools.Metrics` + +### SAM CLI custom template -**Quick hello world example using SAM CLI** +We have provided you with a custom template for the Serverless Application Model (SAM) command-line interface (CLI). This generates a starter project that allows you to interactively choose the Powertools features that enables you to include in your project. ```bash sam init --location https://github.com/aws-samples/cookiecutter-aws-sam-dotnet ``` -## Features +To use the SAM CLI, you need the following tools. -| Utility | Description -| ------------------------------------------------- | --------------------------------------------------------------------------------- -[Tracing](./core/tracing.md) | Decorators and utilities to trace Lambda function handlers, and both synchronous and asynchronous functions -[Logger](./core/logging.md) | Structured logging made easier, and decorator to enrich structured logging with key Lambda context details -[Metrics](./core/metrics.md) | Custom Metrics created asynchronously via CloudWatch Embedded Metric Format (EMF) - -## Environment variables - -!!! info - **Explicit parameters take precedence over environment variables.** - -| Environment variable | Description | Utility | Default | -| ------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | ------------------------------------------------- | -| **POWERTOOLS_SERVICE_NAME** | Sets service name used for tracing namespace, metrics dimension and structured logging | All | `"service_undefined"` | -| **POWERTOOLS_METRICS_NAMESPACE** | Sets namespace used for metrics | [Metrics](./core/metrics) | `None` | -| **POWERTOOLS_TRACE_DISABLED** | Disables tracing | [Tracing](./core/tracing) | `false` | -| **POWERTOOLS_TRACER_CAPTURE_RESPONSE** | Captures Lambda or method return as metadata. | [Tracing](./core/tracing) | `true` | -| **POWERTOOLS_TRACER_CAPTURE_ERROR** | Captures Lambda or method exception as metadata. | [Tracing](./core/tracing) | `true` | -| **POWERTOOLS_LOGGER_LOG_EVENT** | Logs incoming event | [Logging](./core/logging) | `false` | -| **POWERTOOLS_LOGGER_SAMPLE_RATE** | Debug log sampling | [Logging](./core/logging) | `0` | -| **POWERTOOLS_LOG_DEDUPLICATION_DISABLED** | Disables log deduplication filter protection to use Pytest Live Log feature | [Logging](./core/logging) | `false` | +* SAM CLI - [Install the SAM CLI](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-install.html) +* .NET 6.0 (LTS) - [Install .NET 6.0](https://www.microsoft.com/net/download) +* Docker - [Install Docker community edition](https://hub.docker.com/search/?type=edition&offering=community) + +### Examples + +We have provided a few examples that should you how to use the each of the core Powertools features. + +* [Tracer](https://github.com/awslabs/aws-lambda-powertools-dotnet/tree/main/examples/tracer){target="_blank"} example +* [Logger](https://github.com/awslabs/aws-lambda-powertools-dotnet/tree/main/examples/logger/){target="_blank"} example +* [Metrics](https://github.com/awslabs/aws-lambda-powertools-dotnet/tree/main/examples/metrics/){target="_blank"} example + +## Other members of the AWS Lambda Powertools family + +Not using .NET? No problem we have you covered. Here are the other members of the AWS Lambda Powertools family: + +* [AWS Lambda Powertools for Python](https://github.com/awslabs/aws-lambda-powertools-python) +* [AWS Lambda Powertools for Java](https://github.com/awslabs/aws-lambda-powertools-java) +* [AWS Lambda Powertools for TypeScript](https://github.com/awslabs/aws-lambda-powertools-typescript) + +## Connect + +* **AWS Developers Slack**: `#lambda-powertools` - [Invite, if you don't have an account](https://join.slack.com/t/awsdevelopers/shared_invite/zt-yryddays-C9fkWrmguDv0h2EEDzCqvw){target="_blank"} +* **Email**: aws-lambda-powertools-feedback@amazon.com + +## Credits + +* Credits for the Lambda Powertools idea go to [DAZN](https://github.com/getndazn){target="_blank"} and their [DAZN Lambda Powertools](https://github.com/getndazn/dazn-lambda-powertools/){target="_blank"}. diff --git a/docs/references.md b/docs/references.md new file mode 100644 index 00000000..56026d15 --- /dev/null +++ b/docs/references.md @@ -0,0 +1,24 @@ +--- +title: AWS Lambda Powertools for .NET references +description: AWS Lambda Powertools for .NET references +--- + +## Environment variables + +!!! info + **Explicit parameters take precedence over environment variables.** + +| Environment variable | Description | Utility | Default | +| ------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | ------------------------------------------------- | +| **POWERTOOLS_SERVICE_NAME** | Sets service name used for tracing namespace, metrics dimension and structured logging | All | `"service_undefined"` | +| **POWERTOOLS_METRICS_NAMESPACE** | Sets namespace used for metrics | [Metrics](./core/metrics) | `None` | +| **POWERTOOLS_TRACE_DISABLED** | Disables tracing | [Tracing](./core/tracing) | `false` | +| **POWERTOOLS_TRACER_CAPTURE_RESPONSE** | Captures Lambda or method return as metadata. | [Tracing](./core/tracing) | `true` | +| **POWERTOOLS_TRACER_CAPTURE_ERROR** | Captures Lambda or method exception as metadata. | [Tracing](./core/tracing) | `true` | +| **POWERTOOLS_LOGGER_LOG_EVENT** | Logs incoming event | [Logging](./core/logging) | `false` | +| **POWERTOOLS_LOGGER_SAMPLE_RATE** | Debug log sampling | [Logging](./core/logging) | `0` | +| **POWERTOOLS_LOG_DEDUPLICATION_DISABLED** | Disables log deduplication filter protection to use Pytest Live Log feature | [Logging](./core/logging) | `false` | + +## SAM template snippets + +TODO.... diff --git a/docs/tenets.md b/docs/tenets.md new file mode 100644 index 00000000..33c331a1 --- /dev/null +++ b/docs/tenets.md @@ -0,0 +1,13 @@ +--- +title: AWS Lambda Powertools for .NET (developer preview) +description: AWS Lambda Powertools for .NET (developer preview) +--- + +Core utilities such as Tracing, Logging, Metrics, and Event Handler will be available across all Lambda Powertools runtimes. Additional utilities are subjective to each language ecosystem and customer demand. + +* **AWS Lambda only**. We optimise for AWS Lambda function environments and supported runtimes only. Utilities might work with web frameworks and non-Lambda environments, though they are not officially supported. +* **Eases the adoption of best practices**. The main priority of the utilities is to facilitate best practices adoption, as defined in the AWS Well-Architected Serverless Lens; all other functionality is optional. +* **Keep it lean**. Additional dependencies are carefully considered for security and ease of maintenance, and prevent negatively impacting startup time. +* **We strive for backwards compatibility**. New features and changes should keep backwards compatibility. If a breaking change cannot be avoided, the deprecation and migration process should be clearly defined. +* **We work backwards from the community**. We aim to strike a balance of what would work best for 80% of customers. Emerging practices are considered and discussed via Requests for Comment (RFCs) +* **Idiomatic**. Utilities follow programming language idioms and language-specific best practices. From 063d5f4e8ebe797e7a56a5d2ce048700683a61c0 Mon Sep 17 00:00:00 2001 From: Stephen Liedig Date: Mon, 14 Feb 2022 11:53:54 +0800 Subject: [PATCH 3/4] chore: documentation update --- docs/core/logging.md | 6 +++--- docs/core/metrics.md | 25 ++++++++++++------------- docs/core/tracing.md | 25 ++++++++++++++----------- docs/index.md | 4 ++-- 4 files changed, 31 insertions(+), 29 deletions(-) diff --git a/docs/core/logging.md b/docs/core/logging.md index 959f4ab1..bf8e2561 100644 --- a/docs/core/logging.md +++ b/docs/core/logging.md @@ -5,7 +5,7 @@ description: Core utility Logging provides an opinionated logger with output structured as JSON. -**Key features** +## Key features * Capture key fields from Lambda context, cold start and structures logging output as JSON * Log Lambda event when instructed (disabled by default) @@ -21,9 +21,9 @@ Setting | Description | Environment variable | Attribute parameter **Logging level** | Sets how verbose Logger should be (Information, by default) | `LOG_LEVEL` | `LogLevel` **Service** | Sets **Service** key that will be present across all log statements | `POWERTOOLS_SERVICE_NAME` | `Service` -> Example using AWS Serverless Application Model (SAM) +### Example using AWS Serverless Application Model (AWS SAM) -You can also override log level by setting **`POWERTOOLS_LOG_LEVEL`** env var. Here is an example using AWS Serverless Application Model (SAM) +You can also override log level by setting **`POWERTOOLS_LOG_LEVEL`** env var. Here is an example using AWS Serverless Application Model (AWS SAM) === "template.yaml" diff --git a/docs/core/metrics.md b/docs/core/metrics.md index 88f4999e..239c1b43 100644 --- a/docs/core/metrics.md +++ b/docs/core/metrics.md @@ -38,22 +38,21 @@ Setting | Description | Environment variable | Constructor parameter !!! tip "Use your application or main service as the metric namespace to easily group all metrics" -> Example using AWS Serverless Application Model (SAM) +> Example using AWS Serverless Application Model (AWS SAM) === "template.yml" - ```yaml hl_lines="9 10" - Resources: - HelloWorldFunction: - Type: AWS::Serverless::Function - Properties: - ... - Environment: - Variables: - POWERTOOLS_SERVICE_NAME: Payment - POWERTOOLS_METRICS_NAMESPACE: ServerlessAirline - ``` - +```yaml hl_lines="9 10" +Resources: + HelloWorldFunction: + Type: AWS::Serverless::Function + Properties: + ... + Environment: + Variables: + POWERTOOLS_SERVICE_NAME: Payment + POWERTOOLS_METRICS_NAMESPACE: ServerlessAirline +``` === "Function.cs" diff --git a/docs/core/tracing.md b/docs/core/tracing.md index 8d69e957..b3ebd455 100644 --- a/docs/core/tracing.md +++ b/docs/core/tracing.md @@ -8,18 +8,21 @@ a provides functionality to reduce the overhead of performing common tracing tas ![Tracing showcase](../media/tracer_utility_showcase.png) - **Key Features** +## Key Features - * Capture cold start as annotation, and responses as well as full exceptions as metadata - * Helper methods to improve the developer experience of creating new X-Ray subsegments. - * Better developer experience when developing with multiple threads. - * Auto patch supported modules by AWS X-Ray +* 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). +* 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 -Initialization +## Initialization -Before your 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. +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. -> Example using AWS Serverless Application Model (SAM) +To enable active tracing on an AWS Serverless Application Model (AWS SAM) AWS::Serverless::Function resource, use the `Tracing` property. You can use the Globals section of the AWS SAM template to set this for all + +### Using AWS Serverless Application Model (AWS SAM) === "template.yaml" @@ -29,7 +32,7 @@ Before your use this utility, your AWS Lambda function [must have permissions](h Type: AWS::Serverless::Function Properties: ... - Runtime: dotnetcore3.1 + Runtime: dotnet6.0 Tracing: Active Environment: @@ -43,7 +46,7 @@ The Powertools service name is used as the X-Ray namespace. This can be set usin ### Lambda handler To enable Powertools tracing to your function add the `[Tracing]` attribute to your `FunctionHandler` method or on -any method will capture the method as a separate subsegment automatically. You can optionally choose to customize +any method will capture the method as a separate subsegment automatically. You can optionally choose to customize segment name that appears in traces. === "Tracing attribute" @@ -134,7 +137,7 @@ different supported `CaptureMode` to record response, exception or both. **Annotations** are key-values associated with traces and indexed by AWS X-Ray. You can use them to filter traces and to create [Trace Groups](https://aws.amazon.com/about-aws/whats-new/2018/11/aws-xray-adds-the-ability-to-group-traces/) to slice and dice your transactions. -**Metadata** are key-values also associated with traces but not indexed by AWS X-Ray. You can use them to add additional +**Metadata** are key-values also associated with traces but not indexed by AWS X-Ray. You can use them to add additional context for an operation using any native object. === "Annotations" diff --git a/docs/index.md b/docs/index.md index 69263bff..82bec337 100644 --- a/docs/index.md +++ b/docs/index.md @@ -30,7 +30,7 @@ The GitHub repository for this project can be found [here](https://github.com/aw ## Install -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 or from Visual Studio editor. Search `AWS.Lambda.Powertools*` to see various utilities available.Powertools is available on NuGet. * [AWS.Lambda.Powertools.Tracing](https://www.nuget.org/packages?q=AWS.Lambda.Powertools.Tracing): @@ -46,7 +46,7 @@ Powertools is available on NuGet. ### SAM CLI custom template -We have provided you with a custom template for the Serverless Application Model (SAM) command-line interface (CLI). This generates a starter project that allows you to interactively choose the Powertools features that enables you to include in your project. +We have provided you with a custom template for the Serverless Application Model (AWS SAM) command-line interface (CLI). This generates a starter project that allows you to interactively choose the Powertools features that enables you to include in your project. ```bash sam init --location https://github.com/aws-samples/cookiecutter-aws-sam-dotnet From bb6a2d18afe0ee59f67d9b706fc5ebc7364634d6 Mon Sep 17 00:00:00 2001 From: Stephen Liedig Date: Mon, 28 Feb 2022 08:16:26 +0800 Subject: [PATCH 4/4] chore: updated main readme --- README.md | 52 ++++++++++++++++++++++++++++------------------------ 1 file changed, 28 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index ca73f264..900107d4 100644 --- a/README.md +++ b/README.md @@ -1,50 +1,54 @@ -# AWS Lambda Powertools (.NET) +# AWS Lambda Powertools for .NET ![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) -A suite of .NET (C#) utilities for AWS Lambda functions to ease adopting best practices such as tracing, structured logging, custom metrics, and more. ([AWS Lambda Powertools Python](https://github.com/awslabs/aws-lambda-powertools-python) and [AWS Lambda Powertools Java](https://github.com/awslabs/aws-lambda-powertools-java) are also available). +AWS Lambda Powertools for .NET (C#) is suite of utilities for AWS Lambda functions to simplify implementation of serverless observability best practices such as tracing, structured logging, custom metrics. -**[📜 Documentation](https://awslabs.github.io/aws-lambda-powertools-dotnet/)** | **[nuget](https://www.nuget.org/)** | **[Roadmap](https://github.com/awslabs/aws-lambda-powertools-roadmap/projects/1)** | **[Quick hello world example](https://github.com/aws-samples/cookiecutter-aws-sam-dotnet)** | **[Detailed blog post](https://aws.amazon.com/blogs/opensource/simplifying-serverless-best-practices-with-lambda-powertools/)** +**[📜 Documentation](https://awslabs.github.io/aws-lambda-powertools-dotnet/)** | **[NuGet](https://www.nuget.org/)** | **[Roadmap](https://github.com/awslabs/aws-lambda-powertools-roadmap/projects/1)** | **[Examples](#examples)** | **[Blog post](https://aws.amazon.com/blogs/opensource/simplifying-serverless-best-practices-with-lambda-powertools/)** > **Join us on the AWS Developers Slack at `#lambda-powertools`** - **[Invite, if you don't have an account](https://join.slack.com/t/awsdevelopers/shared_invite/zt-gu30gquv-EhwIYq3kHhhysaZ2aIX7ew)** ## Features -* **[Tracing](https://awslabs.github.io/aws-lambda-powertools-dotnet/core/tracing/)** - Decorators and utilities to trace Lambda function handlers, and both synchronous and asynchronous functions -* **[Logging](https://awslabs.github.io/aws-lambda-powertools-dotnet/core/logging/)** - Structured logging made easier, and decorator to enrich structured logging with key Lambda context details -* **[Metrics](https://awslabs.github.io/aws-lambda-powertools-dotnet/core/metrics/)** - Custom Metrics created asynchronously via CloudWatch Embedded Metric Format (EMF) +Lambda Powertools provides three core utilities: + +* **[Logging](https://awslabs.github.io/aws-lambda-powertools-dotnet/core/logging/)** - provides a custom logger class that outputs structured JSON. It allows you to pass in strings or more complex objects, and will take care of serializing the log output. Common use cases—such as logging the Lambda event payload and capturing cold start information—are handled for you, including appending custom keys to the logger at anytime. + +* **[Metrics](https://awslabs.github.io/aws-lambda-powertools-dotnet/core/metrics/)** - makes collecting custom metrics from your application simple, without the need to make synchronous requests to external systems. This functionality is powered by [Amazon CloudWatch Embedded Metric Format (EMF)](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Embedded_Metric_Format.html), which allows for capturing metrics asynchronously. + +* **[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 easily can 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. ### Installation -With Nuget... +The AWS Lambda Powertools for .NET utilities (.NET 6) are available as Nuget packages. You can install the packages from Nuget gallery or from Visual Studio editor. Search `AWS.Lambda.Powertools*` to see various utilities available.Powertools is available on NuGet. -## Examples +* [AWS.Lambda.Powertools.Logging](https://www.nuget.org/packages?q=AWS.Lambda.Powertools.Logging): + + `dotnet nuget add AWS.Lambda.Powertools.Logging` -* [TODO: Add example project here] +* [AWS.Lambda.Powertools.Metrics](https://www.nuget.org/packages?q=AWS.Lambda.Powertools.Metrics): -## Run locally (with .NET 6) + `dotnet nuget add AWS.Lambda.Powertools.Metrics` -.NET 6 is not yet a built-in runtime in Lambda Functions. For that reason, we temporarily run the sample application inside a Docker container. +* [AWS.Lambda.Powertools.Tracing](https://www.nuget.org/packages?q=AWS.Lambda.Powertools.Tracing): -#### Build + `dotnet nuget add AWS.Lambda.Powertools.Tracing` -```bash -sam build -t template-docker.yaml -``` +## Examples -#### Invoke +We have provided examples focused specifically on each of the utilities. Each solution comes with AWS Serverless Application Model (AWS SAM) templates to run your functions as Zip package using the AWS Lambda .NET 6 managed runtime, or as a container package using the AWS base images for .NET. -```bash -sam build -t template-docker.yaml && sam local invoke -``` +* **[Logging example](examples/Logging/README.md)** +* **[Metrics example](examples/Metrics/README.md)** +* **[Tracing example](examples/Tracing/README.md)** -## Deploy +## Other members of the AWS Lambda Powertools family -.NET 6 is not yet a built-in runtime in Lambda Functions. For that reason, we temporarily run the sample application inside a Docker container. +Not using .NET? No problem we have you covered. Here are the other members of the AWS Lambda Powertools family: -```bash -sam build -t template-docker.yaml && sam deploy -``` +* [AWS Lambda Powertools for Python](https://github.com/awslabs/aws-lambda-powertools-python) +* [AWS Lambda Powertools for Java](https://github.com/awslabs/aws-lambda-powertools-java) +* [AWS Lambda Powertools for TypeScript](https://github.com/awslabs/aws-lambda-powertools-typescript) ## Credits