Skip to content

fix!: bump metrics version to 4.0.3 #971

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 15 commits into from
Closed

Conversation

jeromevdl
Copy link
Contributor

@jeromevdl jeromevdl commented Nov 4, 2022

Issue #, if available: #944

Description of changes:

Update aws-embedded-metrics version to v4.0.3 (latest) and adjust the code to handle this bump (from v1.0.6)

Checklist

Breaking change checklist

BREAKING CHANGE

This new version of aws-embedded-metrics introduce Checked Exception for multiple methods (metricsLogger.putMetric(), DimensionSet.of(), ...). Lambda Powertools internally catch them and throws Unchecked Exceptions, but when using the library itself in the Lambda handler, it is now required to handle this exception.

Example:

Before:

metricsLogger.putMetric("CoolMetric", 1);

After:

try {
    metricsLogger.putMetric("CoolMetric", 1);
} catch (InvalidMetricException e) {
    log.error(e);
}

Questions:

  • should powertools-metrics also throw these checked exceptions?
  • Or on the contrary, should powertools-metrics provide a wrapper for the MetricsLogger and hide these exceptions?

Developer Experience is quite bad with these checked exception, with a lot of try catch everywhere in the code...

RFC issue #: #944

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

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

Copy link
Contributor

@kozub kozub left a comment

Choose a reason for hiding this comment

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

We had a couple of days ago a quick discussion about this change with @msailes and he was planing to discuss it also with metrics maintainers. Mark - any comments?

metricsLogger.putMetric("ColdStart", 1, Unit.COUNT);
} catch (InvalidMetricException e) {
// should not occur
Copy link
Contributor

Choose a reason for hiding this comment

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

How about adding sole logs on debug level? Too many times in my live I've seen things that should not occur ;)

@jeromevdl
Copy link
Contributor Author

Switching destination branch to v2, as this cannot be merged into master (v1) because of breaking changes.

dependabot bot and others added 14 commits November 24, 2022 10:59
Bumps `aws.sdk.version` from 2.18.9 to 2.18.13.

Updates `software.amazon.awssdk:bom` from 2.18.9 to 2.18.13
- [Release notes](https://github.com/aws/aws-sdk-java-v2/releases)
- [Changelog](https://github.com/aws/aws-sdk-java-v2/blob/master/CHANGELOG.md)
- [Commits](aws/aws-sdk-java-v2@2.18.9...2.18.13)

Updates `http-client-spi` from 2.18.9 to 2.18.13
- [Release notes](https://github.com/aws/aws-sdk-java-v2/releases)
- [Changelog](https://github.com/aws/aws-sdk-java-v2/blob/master/CHANGELOG.md)
- [Commits](aws/aws-sdk-java-v2@2.18.9...2.18.13)

Updates `url-connection-client` from 2.18.9 to 2.18.13

---
updated-dependencies:
- dependency-name: software.amazon.awssdk:bom
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: software.amazon.awssdk:http-client-spi
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: software.amazon.awssdk:url-connection-client
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [jackson-databind](https://github.com/FasterXML/jackson) from 2.13.4.2 to 2.14.0.
- [Release notes](https://github.com/FasterXML/jackson/releases)
- [Commits](https://github.com/FasterXML/jackson/commits)

---
updated-dependencies:
- dependency-name: com.fasterxml.jackson.core:jackson-databind
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [spotbugs-maven-plugin](https://github.com/spotbugs/spotbugs-maven-plugin) from 4.7.2.1 to 4.7.3.0.
- [Release notes](https://github.com/spotbugs/spotbugs-maven-plugin/releases)
- [Commits](spotbugs/spotbugs-maven-plugin@spotbugs-maven-plugin-4.7.2.1...spotbugs-maven-plugin-4.7.3.0)

---
updated-dependencies:
- dependency-name: com.github.spotbugs:spotbugs-maven-plugin
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* avoid repeated get()

* %s to %d for integer

* change put() to putIfAbsent()

* Update powertools-parameters/src/main/java/software/amazon/lambda/powertools/parameters/cache/DataStore.java

Co-authored-by: Michael Brewer <[email protected]>

* Fix logic for caching json schema.

Co-authored-by: liuxinyu <[email protected]>
Co-authored-by: Pankaj Agrawal <[email protected]>
Co-authored-by: Michael Brewer <[email protected]>
Bumps [mockito-inline](https://github.com/mockito/mockito) from 4.8.1 to 4.9.0.
- [Release notes](https://github.com/mockito/mockito/releases)
- [Commits](mockito/mockito@v4.8.1...v4.9.0)

---
updated-dependencies:
- dependency-name: org.mockito:mockito-inline
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps `aws.xray.recorder.version` from 2.12.0 to 2.13.0.

Updates `aws-xray-recorder-sdk-core` from 2.12.0 to 2.13.0
- [Release notes](https://github.com/aws/aws-xray-sdk-java/releases)
- [Changelog](https://github.com/aws/aws-xray-sdk-java/blob/master/CHANGELOG.md)
- [Commits](aws/aws-xray-sdk-java@v2.12.0...v2.13.0)

Updates `aws-xray-recorder-sdk-aws-sdk-core` from 2.12.0 to 2.13.0
- [Release notes](https://github.com/aws/aws-xray-sdk-java/releases)
- [Changelog](https://github.com/aws/aws-xray-sdk-java/blob/master/CHANGELOG.md)
- [Commits](aws/aws-xray-sdk-java@v2.12.0...v2.13.0)

Updates `aws-xray-recorder-sdk-aws-sdk-v2` from 2.12.0 to 2.13.0
- [Release notes](https://github.com/aws/aws-xray-sdk-java/releases)
- [Changelog](https://github.com/aws/aws-xray-sdk-java/blob/master/CHANGELOG.md)
- [Commits](aws/aws-xray-sdk-java@v2.12.0...v2.13.0)

Updates `aws-xray-recorder-sdk-aws-sdk-v2-instrumentor` from 2.12.0 to 2.13.0
- [Release notes](https://github.com/aws/aws-xray-sdk-java/releases)
- [Changelog](https://github.com/aws/aws-xray-sdk-java/blob/master/CHANGELOG.md)
- [Commits](aws/aws-xray-sdk-java@v2.12.0...v2.13.0)

---
updated-dependencies:
- dependency-name: com.amazonaws:aws-xray-recorder-sdk-core
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: com.amazonaws:aws-xray-recorder-sdk-aws-sdk-core
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: com.amazonaws:aws-xray-recorder-sdk-aws-sdk-v2
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: com.amazonaws:aws-xray-recorder-sdk-aws-sdk-v2-instrumentor
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [aws-lambda-java-core](https://github.com/aws/aws-lambda-java-libs) from 1.2.1 to 1.2.2.
- [Release notes](https://github.com/aws/aws-lambda-java-libs/releases)
- [Commits](https://github.com/aws/aws-lambda-java-libs/commits)

---
updated-dependencies:
- dependency-name: com.amazonaws:aws-lambda-java-core
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps `aws.sdk.version` from 2.18.13 to 2.18.19.

Updates `software.amazon.awssdk:bom` from 2.18.13 to 2.18.19
- [Release notes](https://github.com/aws/aws-sdk-java-v2/releases)
- [Changelog](https://github.com/aws/aws-sdk-java-v2/blob/master/CHANGELOG.md)
- [Commits](aws/aws-sdk-java-v2@2.18.13...2.18.19)

Updates `http-client-spi` from 2.18.13 to 2.18.19
- [Release notes](https://github.com/aws/aws-sdk-java-v2/releases)
- [Changelog](https://github.com/aws/aws-sdk-java-v2/blob/master/CHANGELOG.md)
- [Commits](aws/aws-sdk-java-v2@2.18.13...2.18.19)

Updates `url-connection-client` from 2.18.13 to 2.18.19

---
updated-dependencies:
- dependency-name: software.amazon.awssdk:bom
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: software.amazon.awssdk:http-client-spi
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: software.amazon.awssdk:url-connection-client
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [mockito-core](https://github.com/mockito/mockito) from 4.8.1 to 4.9.0.
- [Release notes](https://github.com/mockito/mockito/releases)
- [Commits](mockito/mockito@v4.8.1...v4.9.0)

---
updated-dependencies:
- dependency-name: org.mockito:mockito-core
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [junit-pioneer](https://github.com/junit-pioneer/junit-pioneer) from 1.7.1 to 1.9.0.
- [Release notes](https://github.com/junit-pioneer/junit-pioneer/releases)
- [Commits](junit-pioneer/junit-pioneer@v1.7.1...v1.9.0)

---
updated-dependencies:
- dependency-name: org.junit-pioneer:junit-pioneer
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps `aws.sdk.version` from 2.18.19 to 2.18.22.

Updates `software.amazon.awssdk:bom` from 2.18.19 to 2.18.22
- [Release notes](https://github.com/aws/aws-sdk-java-v2/releases)
- [Changelog](https://github.com/aws/aws-sdk-java-v2/blob/master/CHANGELOG.md)
- [Commits](aws/aws-sdk-java-v2@2.18.19...2.18.22)

Updates `http-client-spi` from 2.18.19 to 2.18.22
- [Release notes](https://github.com/aws/aws-sdk-java-v2/releases)
- [Changelog](https://github.com/aws/aws-sdk-java-v2/blob/master/CHANGELOG.md)
- [Commits](aws/aws-sdk-java-v2@2.18.19...2.18.22)

Updates `url-connection-client` from 2.18.19 to 2.18.22

---
updated-dependencies:
- dependency-name: software.amazon.awssdk:bom
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: software.amazon.awssdk:http-client-spi
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: software.amazon.awssdk:url-connection-client
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [jackson-databind](https://github.com/FasterXML/jackson) from 2.14.0 to 2.14.1.
- [Release notes](https://github.com/FasterXML/jackson/releases)
- [Commits](https://github.com/FasterXML/jackson/commits)

---
updated-dependencies:
- dependency-name: com.fasterxml.jackson.core:jackson-databind
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/L status/staged-major-release This change will go with the next major release v2 Version 2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants