metrics_cloudwatch
Purpose
Provide a backend for the metrics facade
crate, pushing metrics to CloudWatch.
How to use
Credentials for AWS needs to be available in the environment, see AWS docs on setting up AWS credentials
async
Any labels specified will map to Cloudwatch dimensions
histogram!.record;
Specifying the empty string for the value will remove the default dimension of the same name from the metric.
histogram!.record;
The special @unit label accepts a metrics_cloudwatch::Unit which specifies the unit for the metric (the unit can also be specified when registering the metric). Other @ prefixed labels are ignored.
histogram!.record;
Limitations
The CloudWatch metrics API imposes some limitations.
- Max 30 labels (dimensions) per metric
- Max 150 unique histogram values (used by
timing!()andvalue!()) per API call. Going beyond this works but will incur one API call per batch of 150 unique values. Could be a good idea to measure timing in milliseconds rather than nanoseconds, to keep down the number of unique values.