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

fix(lambda): bump @aws-lambda-powertools/tracer from 1.18.1 to 2.12.0 in /lambdas #620

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dependabot[bot]
Copy link

@dependabot dependabot bot commented on behalf of github Dec 23, 2024

Bumps @aws-lambda-powertools/tracer from 1.18.1 to 2.12.0.

Release notes

Sourced from @​aws-lambda-powertools/tracer's releases.

v2.12.0

Summary

In this release we have made the Logger class more extensible, added POWERTOOLS_METRICS_DISABLED to control metrics output in non production environment, and added AppSyncResolverSchema and KinesisDynamoDBStreamSchema to the parser utility.

⭐️ Thanks to @​zirkelc and @​svozza for their contributions to this release!

Logger class is now more extensible

You can now overwrite the Logger methods createAndPopulateLogItem, printLog, processLogItem, which were private before. This allows you to extend the Logger and add new functionality, i.e. implement your own message buffer.

Metrics utility improvements

You can now set POWERTOOLS_METRICS_DISABLED to control the metrics output. This is useful when you don't want to emit metrics in a non-production environment. When POWERTOOLS_DEV is enabled, the metrics are also suppressed, but you can always explicitly enable it with POWERTOOLS_METRICS_DISABLED .

We have also added a warning message when you overwrite a dimension with the same key, which will help you to troubleshoot unintentional changes:

import { Metrics } from '@aws-lambda-powertools/metrics';

const metrics = new Metrics({ singleMetric: true });

metrics.addDimension('test', 'foo');
metrics.addDimension('test', 'bar'); // "bar" replaces "foo"

// warning: Dimension "test" has already been added. The previous value will be overwritten.

New schema for AppSync and DynamoDB events

You can now use AppSyncResolverSchema and AppSyncResolverBatchSchema to parse AppSync Lambda resolver event.

We have also added KinesisDynamoDBStreamSchema to validate the event from the invocation chain of DynamoDB, Kinesis and Lambda, which are slightly different compared to direct DynamoDB Streams invocations, see more details in #3193.

Changes

  • chore(deps): bump github/codeql-action from 3.27.7 to 3.27.9 (#3422) by @​dependabot
  • chore(deps): bump github/codeql-action from 3.27.5 to 3.27.7 (#3411) by @​dependabot
  • chore(deps): bump actions/setup-node from 4.0.4 to 4.1.0 (#3380) by @​dependabot
  • chore(deps): bump zgosalvez/github-actions-ensure-sha-pinned-actions from 3.0.16 to 3.0.17 (#3362) by @​dependabot
  • chore: replace close-issue-message action (#3364) by @​dreamorosi
  • chore(deps): bump github/codeql-action from 3.27.3 to 3.27.5 (#3336) by @​dependabot
  • chore(parser): return correct type for safeParse in envelopes (#3339) by @​jharlow
  • chore(deps): bump actions/dependency-review-action from 4.4.0 to 4.5.0 (#3344) by @​dependabot
  • chore(deps): bump aws-actions/closed-issue-message from 80edfc24bdf1283400eb04d20a8a605ae8bf7d48 to 37548691e7cc75ba58f85c9f873f9eee43590449 (#3345) by @​dependabot

🌟New features and non-breaking changes

... (truncated)

Changelog

Sourced from @​aws-lambda-powertools/tracer's changelog.

2.12.0 (2024-12-17)

Bug Fixes

Features

  • logger: change selected method visibility to protected (#3377) (93a19a5)
  • metrics: disable metrics with POWERTOOLS_METRICS_DISABLED (#3351) (7e8578e)
  • metrics: warn when overwriting dimension (#3352) (12f3e44)
  • parser: Add appsync resolver event Zod schemas (#3301) (318f34b)
  • parser: add schema for DynamoDB - Kinesis Stream event (#3328) (a8dfa74)

2.11.0 (2024-11-20)

Bug Fixes

  • metrics: skip empty string dimension values (#3319) (924d49d)
  • parser: add aws region to kinesis event (#3260) (246f132)
  • parser: event type literal for selfManagedKafka (#3325) (5350afe)
  • parser: fix cause errors nested structure (#3250) (1ff97cb)

Features

  • batch: Async Processing of Records for for SQS Fifo (#3160) (e73b575)
  • metrics: ability to set custom timestamp with setTimestamp for metrics (#3310) (0fb94c3)
  • metrics: add ability to pass custom logger (#3057) (a531b90)

2.10.0 (2024-10-22)

Features

  • logger: include enumerable properties in formatted errors (#3195) (4b80d9f)

... (truncated)

Upgrade guide

Sourced from @​aws-lambda-powertools/tracer's upgrade guide.


title: Upgrade guide description: Guide to update between major Powertools for AWS Lambda (TypeScript) versions

End of support v1

!!! warning "On March 13th, 2024, Powertools for AWS Lambda (TypeScript) v1 entered maintenance mode, and has reached End-of-Life on September 1st, 2024. If you are still using v1, we strongly recommend you to upgrade to the latest version."

Given our commitment to all of our customers using Powertools for AWS Lambda (TypeScript), we will keep npm v1 releases and documentation 1.x versions to prevent any disruption.

Migrate from v1 to v2

V2 is focused on official support for ESM (ECMAScript modules). We've made other minimal breaking changes to make your transition to v2 as smooth as possible.

Quick summary

Area Change Code change required
ESM support Added ESM support via dual CommonJS and ESM bundling, enabling top-level await and tree-shaking. -
Middy.js Updated import path for Middy.js middlewares to leverage subpath exports - i.e. @aws-lambda-powertools/tracer/middleware. Yes
Types imports Updated import path for TypeScript types to leverage subpath exports - i.e. @aws-lambda-powertools/logger/types. Yes
Logger Changed log sampling to dynamically switch log level to DEBUG on a percentage of requests. -
Logger Updated custom log formatter to include standard as well as persistent keys. Yes
Logger Removed ContextExamples from @aws-lambda-powertools/commons package. Yes
Logger and Tracer Removed deprecated createLogger and createTracer helper functions in favor of direct instantiation. Yes

First steps

Before you start, we suggest making a copy of your current working project or create a new git branch.

  1. Upgrade Node.js to v18 or higher, Node.js v20 is recommended.
  2. Ensure that you have the latest Powertools for AWS Lambda (TypeScript) version via Lambda Layer or npm.
  3. Review the following sections to confirm whether they apply to your codebase.

ESM support

With support for ES Modules in v2, you can now use import instead of require syntax.

This is especially useful when you want to run asynchronous code during the initialization phase by using top-level await.

import { getSecret } from '@aws-lambda-powertools/parameters/secrets';
// This code will run during the initialization phase of your Lambda function
const myApiKey = await getSecret('my-api-key', { transform: 'json' });
export const handler = async (_event: unknown, _context: unknown) => {
</tr></table>

... (truncated)

Commits
  • d5ec97b chore(ci): bump version to 2.12.0 (#3432)
  • 3cd2f02 chore(deps-dev): bump markdownlint-cli2 from 0.15.0 to 0.16.0 (#3418)
  • 97db537 chore(deps-dev): bump zod from 3.23.8 to 3.24.1 (#3419)
  • 2e4f7f4 chore(deps): bump @​types/node from 22.10.1 to 22.10.2 (#3420)
  • f260ebd chore(deps): bump vscode/devcontainers/javascript-node from d493ef0 to `896...
  • 0ee179c chore(deps): bump github/codeql-action from 3.27.7 to 3.27.9 (#3422)
  • 63ff622 chore(deps-dev): bump lint-staged from 15.2.10 to 15.2.11 (#3417)
  • 0da9cea fix(parser): make SNS subject field nullish (#3415)
  • 248a13e docs: add videos section in community (#3416)
  • fb11da8 chore(deps): bump the aws-cdk group across 1 directory with 2 updates (#3413)
  • Additional commits viewable in compare view
Maintainer changes

This version was pushed to npm by aws-powertools-bot, a new releaser for @​aws-lambda-powertools/tracer since your current version.


Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Bumps [@aws-lambda-powertools/tracer](https://github.com/aws-powertools/powertools-lambda-typescript) from 1.18.1 to 2.12.0.
- [Release notes](https://github.com/aws-powertools/powertools-lambda-typescript/releases)
- [Changelog](https://github.com/aws-powertools/powertools-lambda-typescript/blob/main/CHANGELOG.md)
- [Upgrade guide](https://github.com/aws-powertools/powertools-lambda-typescript/blob/main/docs/upgrade.md)
- [Commits](aws-powertools/powertools-lambda-typescript@v1.18.1...v2.12.0)

---
updated-dependencies:
- dependency-name: "@aws-lambda-powertools/tracer"
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot bot added dependencies Pull requests that update a dependency file javascript Pull requests that update Javascript code labels Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file javascript Pull requests that update Javascript code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants