Home > Software engineering >  Send custom metric data to Cloudwatch agent from application
Send custom metric data to Cloudwatch agent from application

Time:10-05

I am trying to send custom metric data of my application to CloudWatch using Cloudwatch Agent.

I am able to successfully send the data to CloudWatch using aws cloudwatch put-metric-data command with AWS CLI, but instead i would like to use the cloudwatch agent to receive my application metrics (connection count , queue count etc) and send that data to cloudwatch via Cloudwatch agent. Please help.

CodePudding user response:

At first, you need to check what metrics CWAgent supports and collects.

Reference: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/metrics-collected-by-CloudWatch-agent.html

From my point of view, CWAgent mostly collects OS metrics that it can read directly from your machine instead of metrics such as connection-count from your application.

The way you did using the put-metric-data is a good direction, you can customize it with your own code.

But recently, AWS did mention about OpenTelemetry which supports application metrics and integrates with CloudWatch Agent. I believe this way is the one you are looking for.

Reference:

  • Related