Skip to content

Commit dc048f5

Browse files
committed
release: 0.28.0
1 parent d390b64 commit dc048f5

File tree

18 files changed

+104
-53
lines changed

18 files changed

+104
-53
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Changelog
22

3-
## Unreleased
3+
## 0.28.0
44

55
**Breaking Changes**:
66

sentry-actix/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "sentry-actix"
3-
version = "0.27.0"
3+
version = "0.28.0"
44
authors = ["Sentry <[email protected]>"]
55
license = "Apache-2.0"
66
readme = "README.md"
@@ -15,7 +15,7 @@ rust-version = "1.60"
1515
[dependencies]
1616
actix-web = { version = "4", default-features = false }
1717
futures-util = { version = "0.3.5", default-features = false }
18-
sentry-core = { version = "0.27.0", path = "../sentry-core", default-features = false, features = ["client"] }
18+
sentry-core = { version = "0.28.0", path = "../sentry-core", default-features = false, features = ["client"] }
1919

2020
[dev-dependencies]
2121
actix-web = { version = "4" }

sentry-anyhow/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "sentry-anyhow"
3-
version = "0.27.0"
3+
version = "0.28.0"
44
authors = ["Sentry <[email protected]>"]
55
license = "Apache-2.0"
66
readme = "README.md"
@@ -17,8 +17,8 @@ default = ["backtrace"]
1717
backtrace = ["anyhow/backtrace"]
1818

1919
[dependencies]
20-
sentry-backtrace = { version = "0.27.0", path = "../sentry-backtrace" }
21-
sentry-core = { version = "0.27.0", path = "../sentry-core" }
20+
sentry-backtrace = { version = "0.28.0", path = "../sentry-backtrace" }
21+
sentry-core = { version = "0.28.0", path = "../sentry-core" }
2222
anyhow = "1.0.39"
2323

2424
[dev-dependencies]

sentry-backtrace/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "sentry-backtrace"
3-
version = "0.27.0"
3+
version = "0.28.0"
44
authors = ["Sentry <[email protected]>"]
55
license = "Apache-2.0"
66
readme = "README.md"
@@ -16,4 +16,4 @@ rust-version = "1.60"
1616
backtrace = "0.3.44"
1717
once_cell = "1"
1818
regex = "1.5.5"
19-
sentry-core = { version = "0.27.0", path = "../sentry-core" }
19+
sentry-core = { version = "0.28.0", path = "../sentry-core" }

sentry-contexts/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "sentry-contexts"
3-
version = "0.27.0"
3+
version = "0.28.0"
44
authors = ["Sentry <[email protected]>"]
55
license = "Apache-2.0"
66
readme = "README.md"
@@ -14,7 +14,7 @@ edition = "2021"
1414
rust-version = "1.60"
1515

1616
[dependencies]
17-
sentry-core = { version = "0.27.0", path = "../sentry-core" }
17+
sentry-core = { version = "0.28.0", path = "../sentry-core" }
1818
libc = "0.2.66"
1919
hostname = "0.3.0"
2020

sentry-core/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "sentry-core"
3-
version = "0.27.0"
3+
version = "0.28.0"
44
authors = ["Sentry <[email protected]>"]
55
license = "Apache-2.0"
66
readme = "README.md"
@@ -33,7 +33,7 @@ frame-pointer = ["pprof?/frame-pointer"]
3333
log = { version = "0.4.8", optional = true, features = ["std"] }
3434
once_cell = "1"
3535
rand = { version = "0.8.1", optional = true }
36-
sentry-types = { version = "0.27.0", path = "../sentry-types" }
36+
sentry-types = { version = "0.28.0", path = "../sentry-types" }
3737
serde = { version = "1.0.104", features = ["derive"] }
3838
serde_json = { version = "1.0.46" }
3939
uuid = { version = "1.0.0", features = ["v4", "serde"], optional = true }

sentry-core/README.md

Lines changed: 57 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,62 @@ This crate follows the [Unified API] guidelines and is centered around
2222
the concepts of [`Client`], [`Hub`] and [`Scope`], as well as the extension
2323
points via the [`Integration`], [`Transport`] and [`TransportFactory`] traits.
2424

25+
## Parallelism, Concurrency and Async
26+
27+
The main concurrency primitive is the [`Hub`]. In general, all concurrent
28+
code, no matter if multithreaded parallelism or futures concurrency, needs
29+
to run with its own copy of a [`Hub`]. Even though the [`Hub`] is internally
30+
synchronized, using it concurrently may lead to unexpected results up to
31+
panics.
32+
33+
For threads or tasks that are running concurrently or outlive the current
34+
execution context, a new [`Hub`] needs to be created and bound for the computation.
35+
36+
```rust
37+
use rayon::prelude::*;
38+
use sentry::{Hub, SentryFutureExt};
39+
use std::sync::Arc;
40+
41+
// Parallel multithreaded code:
42+
let outer_hub = Hub::current();
43+
let results: Vec<_> = [1_u32, 2, 3]
44+
.into_par_iter()
45+
.map(|num| {
46+
let thread_hub = Arc::new(Hub::new_from_top(&outer_hub));
47+
Hub::run(thread_hub, || num * num)
48+
})
49+
.collect();
50+
51+
assert_eq!(&results, &[1, 4, 9]);
52+
53+
// Concurrent futures code:
54+
let futures = [1_u32, 2, 3]
55+
.into_iter()
56+
.map(|num| async move { num * num }.bind_hub(Hub::new_from_top(Hub::current())));
57+
let results = futures::future::join_all(futures).await;
58+
59+
assert_eq!(&results, &[1, 4, 9]);
60+
```
61+
62+
For tasks that are not concurrent and do not outlive the current execution
63+
context, no *new* [`Hub`] needs to be created, but the current [`Hub`] has
64+
to be bound.
65+
66+
```rust
67+
use sentry::{Hub, SentryFutureExt};
68+
69+
// Spawned thread that is being joined:
70+
let hub = Hub::current();
71+
let result = std::thread::spawn(|| Hub::run(hub, || 1_u32)).join();
72+
73+
assert_eq!(result.unwrap(), 1);
74+
75+
// Spawned future that is being awaited:
76+
let result = tokio::spawn(async { 1_u32 }.bind_hub(Hub::current())).await;
77+
78+
assert_eq!(result.unwrap(), 1);
79+
```
80+
2581
## Minimal API
2682

2783
By default, this crate comes with a so-called "minimal" mode. This mode will
@@ -46,13 +102,7 @@ functionality.
46102
[Sentry]: https://sentry.io/
47103
[`sentry`]: https://crates.io/crates/sentry
48104
[Unified API]: https://develop.sentry.dev/sdk/unified-api/
49-
[`Client`]: https://docs.rs/sentry-core/0.27.0/sentry_core/struct.Client.html
50-
[`Hub`]: https://docs.rs/sentry-core/0.27.0/sentry_core/struct.Hub.html
51-
[`Scope`]: https://docs.rs/sentry-core/0.27.0/sentry_core/struct.Scope.html
52-
[`Integration`]: https://docs.rs/sentry-core/0.27.0/sentry_core/trait.Integration.html
53-
[`Transport`]: https://docs.rs/sentry-core/0.27.0/sentry_core/trait.Transport.html
54-
[`TransportFactory`]: https://docs.rs/sentry-core/0.27.0/sentry_core/trait.TransportFactory.html
55-
[`test`]: https://docs.rs/sentry-core/0.27.0/sentry_core/test/index.html
105+
[`test`]: https://docs.rs/sentry-core/0.28.0/sentry_core/test/index.html
56106

57107
## Resources
58108

sentry-debug-images/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "sentry-debug-images"
3-
version = "0.27.0"
3+
version = "0.28.0"
44
authors = ["Sentry <[email protected]>"]
55
license = "Apache-2.0"
66
readme = "README.md"
@@ -15,4 +15,4 @@ rust-version = "1.60"
1515
[dependencies]
1616
findshlibs = "=0.10.2"
1717
once_cell = "1"
18-
sentry-core = { version = "0.27.0", path = "../sentry-core" }
18+
sentry-core = { version = "0.28.0", path = "../sentry-core" }

sentry-debug-images/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ let integration = sentry_debug_images::DebugImagesIntegration::new()
2222
.filter(|event| event.level >= Level::Warning);
2323
```
2424

25-
[`Event`]: https://docs.rs/sentry-debug-images/0.27.0/sentry_debug-images/sentry_core::protocol::Event
25+
[`Event`]: https://docs.rs/sentry-debug-images/0.28.0/sentry_debug_images/sentry_core::protocol::Event
2626

2727
## Resources
2828

sentry-log/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "sentry-log"
3-
version = "0.27.0"
3+
version = "0.28.0"
44
authors = ["Sentry <[email protected]>"]
55
license = "Apache-2.0"
66
readme = "README.md"
@@ -13,7 +13,7 @@ edition = "2021"
1313
rust-version = "1.60"
1414

1515
[dependencies]
16-
sentry-core = { version = "0.27.0", path = "../sentry-core" }
16+
sentry-core = { version = "0.28.0", path = "../sentry-core" }
1717
log = { version = "0.4.8", features = ["std"] }
1818

1919
[dev-dependencies]

sentry-panic/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "sentry-panic"
3-
version = "0.27.0"
3+
version = "0.28.0"
44
authors = ["Sentry <[email protected]>"]
55
license = "Apache-2.0"
66
readme = "README.md"
@@ -13,8 +13,8 @@ edition = "2021"
1313
rust-version = "1.60"
1414

1515
[dependencies]
16-
sentry-core = { version = "0.27.0", path = "../sentry-core" }
17-
sentry-backtrace = { version = "0.27.0", path = "../sentry-backtrace" }
16+
sentry-core = { version = "0.28.0", path = "../sentry-core" }
17+
sentry-backtrace = { version = "0.28.0", path = "../sentry-backtrace" }
1818

1919
[dev-dependencies]
2020
sentry = { path = "../sentry", default-features = false, features = ["test"] }

sentry-slog/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "sentry-slog"
3-
version = "0.27.0"
3+
version = "0.28.0"
44
authors = ["Sentry <[email protected]>"]
55
license = "Apache-2.0"
66
readme = "README.md"
@@ -13,7 +13,7 @@ edition = "2021"
1313
rust-version = "1.60"
1414

1515
[dependencies]
16-
sentry-core = { version = "0.27.0", path = "../sentry-core" }
16+
sentry-core = { version = "0.28.0", path = "../sentry-core" }
1717
slog = { version = "2.5.2", features = ["nested-values"] }
1818
serde_json = "1.0.46"
1919

sentry-tower/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "sentry-tower"
3-
version = "0.27.0"
3+
version = "0.28.0"
44
authors = ["Sentry <[email protected]>"]
55
license = "Apache-2.0"
66
readme = "README.md"
@@ -20,7 +20,7 @@ tower-layer = "0.3"
2020
tower-service = "0.3"
2121
http = { version = "0.2.6", optional = true }
2222
pin-project = { version = "1.0.10", optional = true }
23-
sentry-core = { version = "0.27.0", path = "../sentry-core", default-features = false, features = ["client"] }
23+
sentry-core = { version = "0.28.0", path = "../sentry-core", default-features = false, features = ["client"] }
2424
url = { version = "2.2.2", optional = true }
2525

2626
[dev-dependencies]

sentry-tower/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ transaction based on the incoming HTTP headers.
101101
The created transaction will automatically use the request URI as its name.
102102
This is sometimes not desirable in case the request URI contains unique IDs
103103
or similar. In this case, users should manually override the transaction name
104-
in the request handler using the [`Scope::set_transaction`](https://docs.rs/sentry-tower/0.27.0/sentry_tower/sentry_core::Scope::set_transaction)
104+
in the request handler using the [`Scope::set_transaction`](https://docs.rs/sentry-tower/0.28.0/sentry_tower/sentry_core::Scope::set_transaction)
105105
method.
106106

107107
When combining both layers, take care of the ordering of both. For example

sentry-tracing/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "sentry-tracing"
3-
version = "0.27.0"
3+
version = "0.28.0"
44
authors = ["Sentry <[email protected]>"]
55
license = "Apache-2.0"
66
readme = "README.md"
@@ -13,7 +13,7 @@ edition = "2021"
1313
rust-version = "1.60"
1414

1515
[dependencies]
16-
sentry-core = { version = "0.27.0", path = "../sentry-core", features = ["client"] }
16+
sentry-core = { version = "0.28.0", path = "../sentry-core", features = ["client"] }
1717
tracing-core = "0.1"
1818
tracing-subscriber = { version = "0.3.1", default-features = false, features = ["std"] }
1919

sentry-types/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "sentry-types"
3-
version = "0.27.0"
3+
version = "0.28.0"
44
authors = ["Sentry <[email protected]>"]
55
license = "Apache-2.0"
66
readme = "README.md"

sentry/Cargo.toml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "sentry"
3-
version = "0.27.0"
3+
version = "0.28.0"
44
authors = ["Sentry <[email protected]>"]
55
license = "Apache-2.0"
66
readme = "README.md"
@@ -52,16 +52,16 @@ native-tls = ["dep:native-tls", "reqwest?/default-tls", "ureq?/native-tls"]
5252
rustls = ["dep:rustls", "reqwest?/rustls-tls", "ureq?/tls", "webpki-roots"]
5353

5454
[dependencies]
55-
sentry-core = { version = "0.27.0", path = "../sentry-core", features = ["client"] }
56-
sentry-anyhow = { version = "0.27.0", path = "../sentry-anyhow", optional = true }
57-
sentry-backtrace = { version = "0.27.0", path = "../sentry-backtrace", optional = true }
58-
sentry-contexts = { version = "0.27.0", path = "../sentry-contexts", optional = true }
59-
sentry-debug-images = { version = "0.27.0", path = "../sentry-debug-images", optional = true }
60-
sentry-log = { version = "0.27.0", path = "../sentry-log", optional = true }
61-
sentry-panic = { version = "0.27.0", path = "../sentry-panic", optional = true }
62-
sentry-slog = { version = "0.27.0", path = "../sentry-slog", optional = true }
63-
sentry-tower = { version = "0.27.0", path = "../sentry-tower", optional = true }
64-
sentry-tracing = { version = "0.27.0", path = "../sentry-tracing", optional = true }
55+
sentry-core = { version = "0.28.0", path = "../sentry-core", features = ["client"] }
56+
sentry-anyhow = { version = "0.28.0", path = "../sentry-anyhow", optional = true }
57+
sentry-backtrace = { version = "0.28.0", path = "../sentry-backtrace", optional = true }
58+
sentry-contexts = { version = "0.28.0", path = "../sentry-contexts", optional = true }
59+
sentry-debug-images = { version = "0.28.0", path = "../sentry-debug-images", optional = true }
60+
sentry-log = { version = "0.28.0", path = "../sentry-log", optional = true }
61+
sentry-panic = { version = "0.28.0", path = "../sentry-panic", optional = true }
62+
sentry-slog = { version = "0.28.0", path = "../sentry-slog", optional = true }
63+
sentry-tower = { version = "0.28.0", path = "../sentry-tower", optional = true }
64+
sentry-tracing = { version = "0.28.0", path = "../sentry-tracing", optional = true }
6565
log = { version = "0.4.8", optional = true, features = ["std"] }
6666
reqwest = { version = "0.11", optional = true, features = ["blocking", "json"], default-features = false }
6767
curl = { version = "0.4.25", optional = true }

sentry/README.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ system in Rust as well as a few popular error handling setups.
1616

1717
The most convenient way to use this library is via the [`sentry::init`] function,
1818
which starts a sentry client with a default set of integrations, and binds
19-
it to the current [`Hub`].
19+
it to the current [`Hub`]. More Information on how to use Sentry in parallel,
20+
concurrent and async scenarios can be found on the [`Hub`] docs as well.
2021

2122
The [`sentry::init`] function returns a guard that when dropped will flush Events that were not
2223
yet sent to the sentry service. It has a two second deadline for this so shutdown of
@@ -33,8 +34,8 @@ sentry::capture_message("Hello World!", sentry::Level::Info);
3334
More complex examples on how to use sentry can also be found in [examples]. Extended instructions
3435
may also be found on [Sentry itself].
3536

36-
[`sentry::init`]: https://docs.rs/sentry/0.27.0/sentry/fn.init.html
37-
[`Hub`]: https://docs.rs/sentry/0.27.0/sentry/struct.Hub.html
37+
[`sentry::init`]: https://docs.rs/sentry/0.28.0/sentry/fn.init.html
38+
[`Hub`]: https://docs.rs/sentry/0.28.0/sentry/struct.Hub.html
3839
[examples]: https://github.com/getsentry/sentry-rust/tree/master/sentry/examples
3940
[Sentry itself]: https://docs.sentry.io/platforms/rust
4041

@@ -46,17 +47,17 @@ the ecosystem require a feature flag. For available integrations and how to use
4647
[integrations] and [apply_defaults].
4748

4849
[Features]: #features
49-
[integrations]: https://docs.rs/sentry/0.27.0/sentry/integrations/index.html
50-
[apply_defaults]: https://docs.rs/sentry/0.27.0/sentry/fn.apply_defaults.html
50+
[integrations]: https://docs.rs/sentry/0.28.0/sentry/integrations/index.html
51+
[apply_defaults]: https://docs.rs/sentry/0.28.0/sentry/fn.apply_defaults.html
5152

5253
## Minimal API
5354

5455
This crate comes fully-featured. If the goal is to instrument libraries for usage
5556
with sentry, or to extend sentry with a custom [`Integration`] or a [`Transport`],
5657
one should use the [`sentry-core`] crate instead.
5758

58-
[`Integration`]: https://docs.rs/sentry/0.27.0/sentry/trait.Integration.html
59-
[`Transport`]: https://docs.rs/sentry/0.27.0/sentry/trait.Transport.html
59+
[`Integration`]: https://docs.rs/sentry/0.28.0/sentry/trait.Integration.html
60+
[`Transport`]: https://docs.rs/sentry/0.28.0/sentry/trait.Transport.html
6061
[`sentry-core`]: https://crates.io/crates/sentry-core
6162

6263
## Features

0 commit comments

Comments
 (0)