-
Notifications
You must be signed in to change notification settings - Fork 180
RUST-580 Add tracing integration and command tracing events #757
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
f654434
f8caf7a
9d47a00
8f13e8e
b986b86
4657388
cf22534
bd0fbf3
d288519
6aff38f
2673195
f15e1e6
49c4af6
7e06949
21787e8
c657018
38eeb34
4e4e4bc
4f518d4
5e0c680
0586381
1323f8e
761893c
7e88293
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -548,7 +548,7 @@ functions: | |
working_dir: "src" | ||
script: | | ||
${PREPARE_SHELL} | ||
ASYNC_RUNTIME=${ASYNC_RUNTIME} RUST_VERSION=${RUST_VERSION} MSRV=${MSRV} .evergreen/compile-only.sh | ||
RUST_VERSION=${RUST_VERSION} MSRV=${MSRV} .evergreen/compile-only.sh | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. related to changes in the compile-only.sh script, we no longer need to pass a runtime here, and no longer need to include async runtime in the matrix definition below. |
||
|
||
"check cargo deny": | ||
- command: shell.exec | ||
|
@@ -1858,9 +1858,8 @@ buildvariants: | |
matrix_spec: | ||
os: | ||
- ubuntu-18.04 | ||
async-runtime: "*" | ||
extra-rust-versions: "*" | ||
display_name: "! Compile on Rust ${extra-rust-versions} with ${async-runtime}" | ||
display_name: "! Compile on Rust ${extra-rust-versions}" | ||
tasks: | ||
- "compile-only" | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ if [ "$SINGLE_THREAD" = true ]; then | |
OPTIONS="$OPTIONS --test-threads=1" | ||
fi | ||
|
||
FEATURE_FLAGS="zstd-compression,snappy-compression,zlib-compression,${TLS_FEATURE}" | ||
FEATURE_FLAGS="zstd-compression,snappy-compression,zlib-compression,tracing-unstable,${TLS_FEATURE}" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I initially had planned to introduce separate tasks for testing tracing to avoid introducing any potential extra overhead from having a tracing subscriber registered in every test. however, I tried out just running the tracing tests alongside the other ones, and the total runtime for a full patch seemed to fall within the usual bounds; for the last 10 commits to main patches took anywhere from 14 days, 7 hours to 16 days, 2 hours computing time, and both of mine took around 15 days, 8 hours. So there does not seem to be a ton of overhead. also, if we split out the tracing tasks we would need to separately install rustup, cargo, and driver deps for even more tasks which would probably cancel out any speedup in the other tests. |
||
|
||
if [ "$ASYNC_RUNTIME" = "tokio" ]; then | ||
ASYNC_FEATURE_FLAGS=${FEATURE_FLAGS} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -70,6 +70,11 @@ snappy-compression = ["snap"] | |
# DO NOT USE; see https://jira.mongodb.org/browse/RUST-569 for the status of CSFLE support in the Rust driver. | ||
csfle = ["mongocrypt", "rayon", "num_cpus"] | ||
|
||
# DO NOT USE; see https://jira.mongodb.org/browse/RUST-580 for the status of tracing/logging support in the Rust driver. | ||
# Enables support for emitting tracing events. | ||
# TODO: pending https://github.com/tokio-rs/tracing/issues/2036 stop depending directly on log. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if this doesn't end up getting in before we release I don't think it is a huge deal because we already transitively depend on log via a bunch of our dependencies so we're not adding anything extra to compile here. |
||
tracing-unstable = ["tracing", "log"] | ||
|
||
[dependencies] | ||
async-trait = "0.1.42" | ||
base64 = "0.13.0" | ||
|
@@ -85,6 +90,7 @@ futures-executor = "0.3.14" | |
hex = "0.4.0" | ||
hmac = "0.12.1" | ||
lazy_static = "1.4.0" | ||
log = { version = "0.4.17", optional = true } | ||
md-5 = "0.10.1" | ||
mongocrypt = { git = "https://github.com/mongodb/libmongocrypt-rust.git", branch = "main", optional = true } | ||
num_cpus = { version = "1.13.1", optional = true } | ||
|
@@ -105,6 +111,7 @@ strsim = "0.10.0" | |
take_mut = "0.2.2" | ||
thiserror = "1.0.24" | ||
tokio-openssl = { version = "0.6.3", optional = true } | ||
tracing = { version = "0.1.36", optional = true } | ||
trust-dns-proto = "0.21.2" | ||
trust-dns-resolver = "0.21.2" | ||
typed-builder = "0.10.0" | ||
|
@@ -172,6 +179,7 @@ serde = { version = "*", features = ["rc"] } | |
serde_json = "1.0.64" | ||
semver = "1.0.0" | ||
time = "0.3.9" | ||
tracing-subscriber = "0.3.16" | ||
regex = "1.6.0" | ||
|
||
[package.metadata.docs.rs] | ||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -530,6 +530,20 @@ pub struct ClientOptions { | |||||
#[builder(default)] | ||||||
pub tls: Option<Tls>, | ||||||
|
||||||
/// The maximum number of bytes that the driver should include in a tracing event | ||||||
/// or log message's extended JSON string representation of a BSON document, e.g. a | ||||||
/// command or reply from the server. | ||||||
/// If truncation of a document at the exact specified length would occur in the middle | ||||||
/// of a Unicode codepoint, the document will be truncated at the closest larger length | ||||||
/// which falls on a boundary between codepoints. | ||||||
patrickfreed marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
/// Note that in cases where truncation occurs the output will not be valid JSON. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. actually never mind, I got mixed up here. "will" is the right word to use |
||||||
/// | ||||||
/// The default value is 1000. | ||||||
#[cfg(any(feature = "tracing-unstable", docsrs))] | ||||||
#[cfg_attr(docsrs, doc(cfg(feature = "tracing-unstable")))] | ||||||
#[builder(default)] | ||||||
pub tracing_max_document_length_bytes: Option<usize>, | ||||||
|
||||||
/// Specifies the default write concern for operations performed on the Client. See the | ||||||
/// WriteConcern type documentation for more details. | ||||||
#[builder(default)] | ||||||
|
@@ -1259,6 +1273,8 @@ impl ClientOptions { | |||||
sdam_event_handler: None, | ||||||
#[cfg(test)] | ||||||
test_options: None, | ||||||
#[cfg(feature = "tracing-unstable")] | ||||||
tracing_max_document_length_bytes: None, | ||||||
} | ||||||
} | ||||||
|
||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
couple changes to this script: