Giter Club home page Giter Club logo

Comments (4)

debora-ito avatar debora-ito commented on August 11, 2024 1

-Dcom.amazonaws.sdk.enableDefaultMetrics=cloudwatchRegion=us-east-1

If there's no error in the logs and no metrics are being published to Cloudwatch, my guess is that the system property is not being picked up by your application for some reason, or the application doesn't live long enough to send Cloudwatch metrics (metrics are pooled and sent every 2 minutes or so).

I tested the system property in my local machine and it is working normally, I tested us-east-1 and ap-northeast-1 regions.

If you still want to investigate this, you can try to increase the log level to see if more detailed errors show up when the metrics publisher try to send the requests to Cloudwatch.

from aws-sdk-java.

ByiProX avatar ByiProX commented on August 11, 2024

Hi, I have a test with this sdk and here is what I found.

As a workaround, I tried to enable this feature by adding
AwsSdkMetrics.enableDefaultMetrics();
before sending s3 requests and finally java sdk can send metrics to aws cloudwatch successfully.

However, adding system properties -Dcom.amazonaws.sdk.enableDefaultMetrics=cloudwatchRegion=us-east-1 to jvm is not an effective method since now.
If it is, this may be a sdk issue.

Just for your reference.

from aws-sdk-java.

ByiProX avatar ByiProX commented on August 11, 2024

Hi, debora.
Thanks for your reply.

I have a test in my local machine and still meet the issue.
Before you reply, I have run the application for a long time(0.5h) and enbled the debug level with the log4j tool.
Below is the config of log in my applicatiopn.

log4j.rootLogger=DEBUG, A1
log4j.appender.A1=org.apache.log4j.ConsoleAppender
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%d [%t] %-5p %c -  %m%n
# Turn on DEBUG logging in com.amazonaws.request to log
# a summary of requests/responses with {AWS} request IDs
log4j.logger.com.amazonaws.request=DEBUG

Can you provide the version of java and the java sdk, and do you pass the system property same as my method as below.
java -cp test.jar org.example.S3ClientDemo -Dcom.amazonaws.sdk.enableDefaultMetrics=cloudwatchRegion=cn-north-1

Thanks for your help.

from aws-sdk-java.

debora-ito avatar debora-ito commented on August 11, 2024

I believe system properties should go first:

java -Dcom.amazonaws.sdk.enableDefaultMetrics=cloudwatchRegion=cn-north-1 -cp test.jar org.example.S3ClientDemo

from aws-sdk-java.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.