diff --git a/CHANGELOG.md b/CHANGELOG.md index 19908376..32b10b15 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,12 @@ Versioning](http://semver.org/spec/v2.0.0.html). ## [Unreleased] +## [0.7.0] - 2022-04-25 + +### Added +- OptionsBuilder API for more flexibly specifying client options - https://github.com/mcasper/dogstatsd-rs/pull/35 +- Ability to provide default tags that should be sent with all events - https://github.com/mcasper/dogstatsd-rs/pull/34 + ## [0.6.2] - 2021-01-26 ### Fixed diff --git a/Cargo.toml b/Cargo.toml index f8b06e00..cd3bb02e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "dogstatsd" -version = "0.6.2" +version = "0.7.0" authors = ["Matt Casper "] license = "MIT" description = "A DogstatsD client for Rust." diff --git a/README.md b/README.md index 8f4dc676..7df2492e 100644 --- a/README.md +++ b/README.md @@ -23,9 +23,13 @@ let default_options = Options::default(); let default_client = Client::new(default_options).unwrap(); // Binds to 127.0.0.1:9000 for transmitting and sends to 10.1.2.3:8125, with a -// namespace of "analytics", and a default tag of "region:west". -let custom_options = Options::new("127.0.0.1:9000", "10.1.2.3:8125", "analytics", "region:west"); +// namespace of "analytics". +let custom_options = Options::new("127.0.0.1:9000", "10.1.2.3:8125", "analytics", vec!(String::new())); let custom_client = Client::new(custom_options).unwrap(); + +// You can also use the OptionsBuilder API to avoid needing to specify every option. +let built_options = OptionsBuilder::new().from_addr(String::from("127.0.0.1:9001")).build(); +let built_client = Client::new(built_options).unwrap(); ``` Start sending metrics: diff --git a/src/lib.rs b/src/lib.rs index eb67126b..8c9370ab 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -9,7 +9,7 @@ //! Build an options struct and create a client: //! //! ``` -//! use dogstatsd::{Client, Options}; +//! use dogstatsd::{Client, Options, OptionsBuilder}; //! //! // Binds to a udp socket on an available ephemeral port on 127.0.0.1 for //! // transmitting, and sends to 127.0.0.1:8125, the default dogstatsd @@ -21,6 +21,10 @@ //! // namespace of "analytics". //! let custom_options = Options::new("127.0.0.1:9000", "10.1.2.3:8125", "analytics", vec!(String::new())); //! let custom_client = Client::new(custom_options).unwrap(); +//! +//! // You can also use the OptionsBuilder API to avoid needing to specify every option. +//! let built_options = OptionsBuilder::new().from_addr(String::from("127.0.0.1:9001")).build(); +//! let built_client = Client::new(built_options).unwrap(); //! ``` //! //! Start sending metrics: