Skip to content

Commit

Permalink
[DEVEX-2389]: Export new types (#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
cpiemontese authored Dec 3, 2024
1 parent 45cae55 commit cd238cc
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 25 deletions.
56 changes: 36 additions & 20 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,40 @@
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
and this project adheres to
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

---

## [0.9.0] - 2024-11-25
## [0.9.1] - 2024-12-03

### Added

- Export `EventAlertType` and `BatchingOptions` (under
`configuration::BatchingOptions`) from `dogstatsd`

---

## [0.9.0] - 2024-11-25

### Changed

- Bump `dogstatsd` to 0.12
- Bumped MSRV to 1.74
- `event!` macro can now accept `EventOptions` as last argument before tags, [see the original repo](https://github.com/mcasper/dogstatsd-rs) for more details
- `event!` macro can now accept `EventOptions` as last argument before tags,
[see the original repo](https://github.com/mcasper/dogstatsd-rs) for more
details

---

## [0.8.0] - 2024-06-21

## Changed

- **Breaking**: `with_country` will now add the `prima_country` tag instead of `prima:country`
- **Breaking**: `with_country` will now add the `prima_country` tag instead of
`prima:country`

---

Expand All @@ -33,14 +45,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added

- Default tag set has new values based on the environment variables:
* KUBE_APP_PART_OF
* KUBE_APP_MANAGED_BY
* KUBE_APP_VERSION
* KUBE_APP_INSTANCE
- KUBE_APP_PART_OF
- KUBE_APP_MANAGED_BY
- KUBE_APP_VERSION
- KUBE_APP_INSTANCE

---


## [0.7.1] - 2024-03-05

### Added
Expand All @@ -65,23 +76,27 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- **BREAKING CHANGES**:
- `PrimaConfiguration` is now `Config`
- `Config::new` now takes only 2 arguments, `to_addr` and `namespace`
- `from_addr` is now `0.0.0.0:0` by default, but can be customized using `.with_from_addr`
- `from_addr` is now `0.0.0.0:0` by default, but can be customized using
`.with_from_addr`

---

## [0.6.0] - 2023-10-02

### Added

- Socket path and batching options can now be optionally set as part of the configuration
- Socket path and batching options can now be optionally set as part of the
configuration
- `async_time` macro to collect timing with asynchronous functions.
- `PrimaConfiguration` new function `with_environment` to optionally add an env.

### Removed

- **BREAKING CHANGE**: `PrimaConfiguration::new` function no longer takes `env` parameter.
- **BREAKING CHANGE**: `PrimaConfiguration::new` function no longer takes `env`
parameter.
- Use `with_environment` function to manually set the `env:{env}` tag
- If no environment is set the library will use `DD_ENV` var by default if set.
- If no environment is set the library will use `DD_ENV` var by default if
set.

## [0.5.0] - 2022-12-05

Expand All @@ -92,7 +107,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

- Fixed 0.4.0 backwards compatibility, relating to errors in some macro definitions
- Fixed 0.4.0 backwards compatibility, relating to errors in some macro
definitions
- Fixed various documentation errors

---
Expand All @@ -101,7 +117,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- Added support for custom metric tracking via tag cardinality. See documentation in library header and `TagTrackerConfiguration`
- Added support for custom metric tracking via tag cardinality. See
documentation in library header and `TagTrackerConfiguration`
- No longer allocate when it can be avoided

---
Expand All @@ -122,7 +139,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- `Datadog::new` reintroduced `is_reporting_enabled`.
- `Datadog::new` is now a private function for tests.
- (Behaviour): The client, if not initialized, don't send metrics and don't panic.
- (Behaviour): The client, if not initialized, don't send metrics and don't
panic.

### Removed

Expand Down Expand Up @@ -160,10 +178,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [0.1.5]




[Unreleased]: https://github.com/primait/prima_datadog.rs/compare/0.9.0...HEAD
[Unreleased]: https://github.com/primait/prima_datadog.rs/compare/0.9.1...HEAD
[0.9.1]: https://github.com/primait/prima_datadog.rs/compare/0.9.0...0.9.1
[0.9.0]: https://github.com/primait/prima_datadog.rs/compare/0.8.0...0.9.0
[0.8.0]: https://github.com/primait/prima_datadog.rs/compare/0.7.2...0.8.0
[0.7.2]: https://github.com/primait/prima_datadog.rs/compare/0.7.1...0.7.2
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description = "An opinionated library to share code and approach to Datadog logg
edition = "2018"
license = "MIT"
name = "prima_datadog"
version = "0.9.0"
version = "0.9.1"

[features]
default = []
Expand Down
8 changes: 5 additions & 3 deletions src/configuration/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ mod env;
pub use country::Country;
pub use env::Environment;

pub use dogstatsd::BatchingOptions;

use crate::TagTrackerConfiguration;
use std::fmt::Display;

Expand All @@ -23,7 +25,7 @@ pub struct Configuration {
tags: Vec<String>,
tracker: TagTrackerConfiguration,
socket_path: Option<String>,
batching_options: Option<dogstatsd::BatchingOptions>,
batching_options: Option<BatchingOptions>,
}

impl Configuration {
Expand Down Expand Up @@ -68,7 +70,7 @@ impl Configuration {
self
}

pub fn with_batching_options(mut self, batching_options: dogstatsd::BatchingOptions) -> Self {
pub fn with_batching_options(mut self, batching_options: BatchingOptions) -> Self {
self.batching_options = Some(batching_options);
self
}
Expand All @@ -93,7 +95,7 @@ impl Configuration {
self.socket_path.clone()
}

pub fn batching_options(&self) -> Option<dogstatsd::BatchingOptions> {
pub fn batching_options(&self) -> Option<BatchingOptions> {
self.batching_options
}

Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
use std::future::Future;

use configuration::Configuration;
pub use dogstatsd::{EventOptions, ServiceCheckOptions, ServiceStatus};
pub use dogstatsd::{EventAlertType, EventOptions, EventPriority, ServiceCheckOptions, ServiceStatus};
use once_cell::sync::OnceCell;

pub use client::DogstatsdClient;
Expand Down

0 comments on commit cd238cc

Please sign in to comment.