Skip to content

Commit

Permalink
Switch from the chrono clock feature to now
Browse files Browse the repository at this point in the history
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
  • Loading branch information
edmorley committed Feb 23, 2024
1 parent 98cd103 commit 0320780
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions opentelemetry-stdout/CHANGELOG.md
Expand Up @@ -2,6 +2,10 @@

## vNext

### Changed

- Adjusted `chrono` features to reduce number of transitive dependencies. [#1569](https://github.com/open-telemetry/opentelemetry-rust/pull/1569)

## v0.2.0

### Changed
Expand Down
2 changes: 1 addition & 1 deletion opentelemetry-stdout/Cargo.toml
Expand Up @@ -22,7 +22,7 @@ logs = ["opentelemetry/logs", "opentelemetry_sdk/logs", "async-trait", "thiserro

[dependencies]
async-trait = { workspace = true, optional = true }
chrono = { version = "0.4.22", default-features = false, features = ["clock"] }
chrono = { version = "0.4.34", default-features = false, features = ["now"] }
thiserror = { workspace = true, optional = true }
futures-util = { workspace = true, optional = true }
opentelemetry = { version = "0.21", path = "../opentelemetry", default_features = false }
Expand Down

0 comments on commit 0320780

Please sign in to comment.