metrics_cloudwatch_embedded
The interface is not stable
This is a Minimum Viable Product for feedback, experimentation and iteration
Purpose
Provide a backend for the metrics facade crate,
to emit metrics in CloudWatch Embedded Metrics Format
Intended for use with the lambda_runtime, however Collector::flush_to(...) could be used
for anything that writes logs that end up in CloudWatch.
How to use
let metrics = new
.cloudwatch_namespace
.init
.unwrap;
increment_counter!;
metrics
.set_property
.flush;
Limitations
- Histograms retain up to 100 values (the maximum for a single metric document) between calls to
Collector::flush(), overflow is silently dropped - Dimensions set at initialization via
Builder::with_dimension(...)may not overlap with metric labels - Only the subset of metric units in
metrics::Unitare supported [https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_MetricDatum.html] - Registering different metric types with the same
metrics::Keywill silently fail
Thanks
- Simon Andersson (ramn) and contributors - For the metrics_cloudwatch crate I used as a reference
- Toby Lawrence (tobz) - For answering my metrics crate questions before I even had something working