Skip to content

Commit 0320780

Browse files
committed
Switch from the chrono clock feature to now
In #1192, `chrono` was added as a dependency of the `opentelemetry-stdout` crate in order to support outputting timestamps in human readable format. In that PR, all Chrono features were disabled apart from the `clock` feature. However, since that change landed, `chrono` has added support for an even finer-grained feature named `now`, which is a subset of the `clock` feature which excludes timezone support, and so avoids pulling in many timezone related crates. `opentelemetry-stdout` only uses chrono's UTC features, so we can switch from using the `clock` feature to using `now` instead. After this change, the following transitive dependencies are no longer pulled in: - `android-tzdata` - `android_system_properties` - `cc` - `core-foundation-sys` - `iana-time-zone` - `iana-time-zone-haiku` - `windows-core` - `windows-targets` - `windows_aarch64_gnullvm` - `windows_aarch64_msvc` - `windows_i686_gnu` - `windows_i686_msvc` - `windows_x86_64_gnu` - `windows_x86_64_gnullvm` - `windows_x86_64_msvc` See: chronotope/chrono#1343 https://github.com/chronotope/chrono/blob/main/README.md#crate-features
1 parent 98cd103 commit 0320780

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

opentelemetry-stdout/CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## vNext
44

5+
### Changed
6+
7+
- Adjusted `chrono` features to reduce number of transitive dependencies. [#1569](https://github.com/open-telemetry/opentelemetry-rust/pull/1569)
8+
59
## v0.2.0
610

711
### Changed

opentelemetry-stdout/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ logs = ["opentelemetry/logs", "opentelemetry_sdk/logs", "async-trait", "thiserro
2222

2323
[dependencies]
2424
async-trait = { workspace = true, optional = true }
25-
chrono = { version = "0.4.22", default-features = false, features = ["clock"] }
25+
chrono = { version = "0.4.34", default-features = false, features = ["now"] }
2626
thiserror = { workspace = true, optional = true }
2727
futures-util = { workspace = true, optional = true }
2828
opentelemetry = { version = "0.21", path = "../opentelemetry", default_features = false }

0 commit comments

Comments
 (0)