Skip to content

RFC: bump aws-embedded-metrics from 1.0.6 to 4.0.1 #944

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
kozub opened this issue Oct 3, 2022 · 4 comments
Closed

RFC: bump aws-embedded-metrics from 1.0.6 to 4.0.1 #944

kozub opened this issue Oct 3, 2022 · 4 comments
Assignees
Labels
triage v2 Version 2

Comments

@kozub
Copy link
Contributor

kozub commented Oct 3, 2022

Key information

Summary

There are some work required to bump aws-embedded-metrics to 4.0.1

Motivation

I had a quick look on the issue that appeared when dependabot bumped aws-embedded-metrics to 4.0.1.

I looks that in latest version some components of aws-embedded-metrics throw checked exceptions which are not handled in the app. I will create a PR showing the issue and fix.

@n8m8
Copy link

n8m8 commented Oct 28, 2022

Work on this would be much appreciated, I'm running into these excessive socket error logs upon using MetricsUtils.withSingleMetric when running unit tests, which I've been suggested can be reduced by bumping aws-embedded-metrics to > 2.x.

ERROR TCPClient:43 - Failed to connect to the socket due to the exception: 
java.net.SocketException: Socket closed
    at java.net.PlainSocketImpl.socketConnect(Native Method) ~[?:1.8.0_332]
    at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350) ~[?:1.8.0_332]
    at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) ~[?:1.8.0_332]
    at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) ~[?:1.8.0_332]
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) ~[?:1.8.0_332]
    at java.net.Socket.connect(Socket.java:607) ~[?:1.8.0_332]
    at java.net.Socket.connect(Socket.java:556) ~[?:1.8.0_332]
    at software.amazon.cloudwatchlogs.emf.sinks.TCPClient.connect(TCPClient.java:40) ~[aws-embedded-metrics-1.0.6.jar:1.0.6]
    at software.amazon.cloudwatchlogs.emf.sinks.TCPClient.sendMessage(TCPClient.java:63) ~[aws-embedded-metrics-1.0.6.jar:1.0.6]
    at software.amazon.cloudwatchlogs.emf.sinks.AgentSink.accept(AgentSink.java:52) ~[aws-embedded-metrics-1.0.6.jar:1.0.6]
    at software.amazon.cloudwatchlogs.emf.logger.MetricsLogger.flush(MetricsLogger.java:66) ~[aws-embedded-metrics-1.0.6.jar:1.0.6]
    at software.amazon.lambda.powertools.metrics.MetricsUtils.withSingleMetric(MetricsUtils.java:120) ~[powertools-metrics-1.12.2.jar:?]

@markkuhn
Copy link

I would recommend using v4.0.3 instead as there is a known bug in v4.0.1 which affects most users.

@jeromevdl jeromevdl self-assigned this Nov 4, 2022
@jeromevdl
Copy link
Contributor

This introduces breaking changes:
A simple metricsLogger.putMetric(...) now throws checked exception (InvalidMetricException).

This should be released in a v2 of lambda-powertools-metrics.

@msailes
Copy link
Contributor

msailes commented Feb 18, 2023

I'm going to close this issue because we have a much clearer issue and reason why we want to upgrade now. #1041 requires v4.x and gives an additional feature we want to support.

@msailes msailes closed this as completed Feb 18, 2023
@scottgerring scottgerring added this to the v2 milestone Dec 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage v2 Version 2
Projects
None yet
Development

No branches or pull requests

7 participants