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/CHANGELOG.md b/CHANGELOG.md index c524de1..543af89 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## 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 +* 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 0a7bf9d..ed84426 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,9 +1,9 @@ [package] name = "metrics_cloudwatch_embedded" -version = "0.8.0" +version = "0.9.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" @@ -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" diff --git a/README.md b/README.md index e9f0916..6c0cea1 100644 --- a/README.md +++ b/README.md @@ -27,19 +27,19 @@ 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 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"] } ``` @@ -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 ------- @@ -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. 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"); + } + } }