From 25278c0ef0bb6577027296daa1c559c7f3348e6f Mon Sep 17 00:00:00 2001 From: Brian Morin Date: Sat, 17 Jan 2026 17:44:01 -0800 Subject: [PATCH 1/5] try an MSRV of 0.84 to match aws-lambda --- .github/workflows/check.yml | 2 +- Cargo.toml | 2 +- README.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 3941727..f7df78d 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -74,7 +74,7 @@ jobs: # https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability strategy: matrix: - msrv: [1.90] + msrv: [1.84] name: ubuntu / ${{ matrix.msrv }} steps: - uses: actions/checkout@v4 diff --git a/Cargo.toml b/Cargo.toml index 0a7bf9d..e48a37e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ name = "metrics_cloudwatch_embedded" version = "0.8.0" authors = ["brianmorin "] edition = "2021" -rust-version = "1.90" +rust-version = "1.84" description = "CloudWatch embedded metrics format emitter for the metrics crate" license = "Apache-2.0" diff --git a/README.md b/README.md index e9f0916..e13c662 100644 --- a/README.md +++ b/README.md @@ -121,7 +121,7 @@ more than 30 dimensions/labels will fail with an error via the `tracing` crate Supported Rust Versions (MSRV) ------------------------------ -This crate requires a minimum of Rust 1.90, and is not guaranteed to build on compiler versions earlier than that. +This crate requires a minimum of Rust 1.84, and is not guaranteed to build on compiler versions earlier than that. License ------- From 8f1f608c435d34ca7795ec0c7b7c6322397b38a4 Mon Sep 17 00:00:00 2001 From: Brian Morin Date: Sat, 17 Jan 2026 17:47:43 -0800 Subject: [PATCH 2/5] Bump version number, update docs --- CHANGELOG.md | 6 ++++++ Cargo.toml | 2 +- README.md | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c524de1..4a000ac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## v0.9.0 (2026-01-17) +* Update lambda_http dependency contributed by Roger Wilson (CaptainJiNX) +* Correctly error and not block if there is an attempt to send more than 100 histogram values before flushing contributed by Aaron1011 + (Aaron1011) +* MSRV increased to 1.84 + ## v0.8.0 (2025-06-22) * Update lambda_http dependency contributed by Roger Wilson (CaptainJiNX) diff --git a/Cargo.toml b/Cargo.toml index e48a37e..863081d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "metrics_cloudwatch_embedded" -version = "0.8.0" +version = "0.9.0" authors = ["brianmorin "] edition = "2021" rust-version = "1.84" diff --git a/README.md b/README.md index e13c662..b64f9a9 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ It also provides optional helpers for: In your Cargo.toml add: ```toml metrics = "0.24" -metrics_cloudwatch_embedded = { version = "0.8.0", features = ["lambda"] } +metrics_cloudwatch_embedded = { version = "0.9.0", features = ["lambda"] } tracing-subscriber = { version = "0.3", default-features = false, features = ["fmt", "env-filter", "json"] } ``` From af9029ad0fc4097f5a0d0159d217427de9bada32 Mon Sep 17 00:00:00 2001 From: Brian Morin Date: Sat, 17 Jan 2026 17:57:59 -0800 Subject: [PATCH 3/5] Add a failing test for too many histogram values --- src/test.rs | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/src/test.rs b/src/test.rs index 11e9d2a..6d20df0 100644 --- a/src/test.rs +++ b/src/test.rs @@ -145,4 +145,39 @@ mod tests { ); } } + + rusty_fork_test! { + #[test] + fn too_many_histogram_values() { + use std::sync::mpsc; + use std::time::Duration; + + let (tx, rx) = mpsc::channel(); + std::thread::spawn(move || { + let port = format!("{}", 7779); + let metrics = builder::Builder::new() + .cloudwatch_namespace("namespace") + .with_dimension("Address", "10.172.207.225") + .with_dimension("Port", port) + .with_timestamp(1687657545423) + .emit_zeros(true) + .init() + .unwrap(); + + metrics::describe_counter!("success", metrics::Unit::Count, ""); + metrics::describe_histogram!("runtime", metrics::Unit::Milliseconds, ""); + + for _ in 0..200 { + metrics::histogram!("runtime", "module" => "directory", "api" => "a_function").record(4.0); + } + + let mut output = Vec::new(); + metrics.flush(&mut output).unwrap(); + tx.send(()).unwrap(); + }); + + rx.recv_timeout(Duration::from_secs(3)) + .expect("Test timed out after 3 seconds"); + } + } } From c4e50f1abc16824fbce9ae3a8ca6e77a07f029e0 Mon Sep 17 00:00:00 2001 From: Brian Morin Date: Sat, 17 Jan 2026 18:07:06 -0800 Subject: [PATCH 4/5] Update tower to 0.5.3 --- CHANGELOG.md | 1 + Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4a000ac..543af89 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ * Correctly error and not block if there is an attempt to send more than 100 histogram values before flushing contributed by Aaron1011 (Aaron1011) * MSRV increased to 1.84 +* Updated tower to 0.5.3 ## v0.8.0 (2025-06-22) * Update lambda_http dependency contributed by Roger Wilson (CaptainJiNX) diff --git a/Cargo.toml b/Cargo.toml index 863081d..ed84426 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -31,7 +31,7 @@ metrics = "0.24" pin-project = { version = "1", optional = true } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" -tower = { version = "0.5.2", optional = true } +tower = { version = "0.5.3", optional = true } tracing = "0.1" futures = "0.3" bytes = "1" From 76bd5600dce4ce30a0e483a4f01e801502f506b3 Mon Sep 17 00:00:00 2001 From: Brian Morin Date: Sat, 17 Jan 2026 18:13:44 -0800 Subject: [PATCH 5/5] spelling fixes, allow AWS to take over the project if desired --- README.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b64f9a9..6c0cea1 100644 --- a/README.md +++ b/README.md @@ -27,12 +27,12 @@ metrics AWS Lambda Example ------------------ -The [Lambda Runtime](https://crates.io/crates/lambda-runtime) intergration feature handles flushing metrics +The [Lambda Runtime](https://crates.io/crates/lambda-runtime) integration feature handles flushing metrics after each invoke via either `run()` alternatives or `MetricService` which implements the [`tower::Service`](https://crates.io/crates/tower) trait. It also provides optional helpers for: -* emiting a metric on cold starts +* emitting a metric on cold starts * wrapping cold starts in a [`tracing`](https://crates.io/crates/tracing) span * decorating metric documents with request id and/or x-ray trace id @@ -139,3 +139,9 @@ 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 + +Continuation/Abandonment +------------------------- + +I grant permission for Amazon Web Services (https://github.com/aws) to take over this project if I +am no longer able to maintain it or have abandoned it.