aws / aws-sdk-java

The official AWS SDK for Java 1.x (In Maintenance Mode, End-of-Life on 12/31/2025). The AWS SDK for Java 2.x is available here: https://github.com/aws/aws-sdk-java-v2/
https://aws.amazon.com/sdkforjava
Apache License 2.0
4.13k stars 2.83k forks source link

AWS SDK Metrics not reporting HttpClientPoolAvailableCount or HttpClientPoolPendingCount #3099

Closed AndrewMacKenzieFD closed 7 months ago

AndrewMacKenzieFD commented 8 months ago

Upcoming End-of-Support

Describe the bug

version 1.11.804

aws-sdk-core - AwsSdkMetrics

We are attempting to use this package in order to monitor our SNS connection pools, during testing we have observed that both HttpClientPoolAvailableCount & HttpClientPoolPendingCount are not being reported when making requests, but HttpClientPoolLeasedCount is.

We have implemented our own RequestMetricCollector with additional logging and can confirm that there are no instances of the aforementioned metrics as part of the AWSRequestMetrics object on the requests in question from both SNS and SQS.

Expected Behavior

We would expect these metrics to be produced.

Current Behavior

The metrics HttpClientPoolAvailableCount & HttpClientPoolPendingCount are not being reported as part of the Request inside the AWSRequestMetrics object during any SNS or SQS operation.

Reproduction Steps

  1. AwsSdkMetrics enabled for application
  2. SNS sync client created, using NotificationMessagingTemplate to publish messages

Possible Solution

No response

Additional Information/Context

No response

AWS Java SDK version used

1.11.804

JDK version used

17

Operating System and version

docker - eclipse-temurin:17-alpine

debora-ito commented 7 months ago

@AndrewMacKenzieFD there's no obvious reasons why the SDK would not obtain HttpClientPoolAvailableCount or HttpClientPoolPendingCount, specially because the three metrics are captured at the same time:

https://github.com/aws/aws-sdk-java/blob/53c5f6bc86ebd255839eda363e95f13480b29361/aws-java-sdk-core/src/main/java/com/amazonaws/http/AmazonHttpClient.java#L1546-L1549

Is this something reproducible? Is it intermittent or it happens every time?

JDK 17 is not supported in the Java SDK v1, this could be related but I'm not sure. Could you test with JDK <= 16?

github-actions[bot] commented 7 months ago

It looks like this issue has not been active for more than five days. In the absence of more information, we will be closing this issue soon. If you find that this is still a problem, please add a comment to prevent automatic closure, or if the issue is already closed please feel free to reopen it.