Amazon CloudWatch monitors your Amazon Web Services (AWS) resources and the applications you run on AWS in real time. You can use CloudWatch to collect and track metrics, which are variables you can measure for your resources and applications.
Implementation to collect application usage, performance, and event metrics to ensure proper functioning of application components and alert in case of anomalies.
Technology: Review with the operations team the use of native AWS services such as CloudWatch, implement OpenTelemetry in combination with Splunk and Nagios.
TBD
Sample query:
fields @timestamp, @message
| filter @message like /From: caronte@uoc.edu/
| sort @timestamp desc
| limit 20
Query your metrics with CloudWatch Metrics Insights:
Syntax:
SELECT FUNCTION(metricName)
FROM namespace | SCHEMA(...)
[ WHERE labelKey OPERATOR labelValue [AND ... ] ]
[ GROUP BY labelKey [ , ... ] ]
[ ORDER BY FUNCTION() [ DESC | ASC ] ]
[ LIMIT number ]
Publishing custom metrics
https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/publishingMetrics.html
A dimension further clarifies what the metric is and what data it stores. You can have up to 10 dimensions in one metric, and each dimension is defined by a name and value pair.
putMetricData() Node.js asynchronous call example:
https://stackoverflow.com/a/59544260/1323562
For Terraform, see:
https://sites.google.com/site/pawneecity/terraform/cloudwatch-terraform