Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,8 @@ members = [
"tracing-actix-web-mozlog",
"actix-web-location",
]

[workspace.package]
version = "0.8.0"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think you should do workspace lib versioning like this. Recommend keeping each crate with it's own version field. Other shared fields below here make sense though.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I go back and forth about this quite a bit. The plus being when we tag a release, do a library check, etc. we only have one location we need to update.
The downside is that these crates are very loosely bound together under a fairly arbitrary collector.

I'll revert the version number change for now, but I still kinda would like to keep the version work simplified where possible.

license = "MPL-2.0"
edition = "2021"
11 changes: 6 additions & 5 deletions actix-web-location/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
[package]

name = "actix-web-location"
version = "0.7.0"
description = "A extensible crate to provide location determination for actix-web, using GeoIP or other techniques"
license = "MPL-2.0"
edition = "2021"
documentation = "https://docs.rs/actix-web-location"
repository = "https://github.com/mozilla-services/common-rs"
homepage = "https://github.com/mozilla-services/common-rs/tree/master/actix-web-location"
version = "0.8.0"
edition.workspace = true
license.workspace = true

[package.metadata.docs.rs]
# features that docs.rs will build with
Expand All @@ -22,7 +23,7 @@ thiserror = "1"
anyhow = "1"
async-trait = "0.1"
lazy_static = "1"
maxminddb = { version = "0.22", optional = true}
maxminddb = { version = "0.23", optional = true}
cadence = { version = "0.29", optional = true}

[features]
Expand All @@ -34,7 +35,7 @@ actix-web-v4 = ["actix-web-4"]
[dev_dependencies]
actix-rt = "2.2"
actix-web-4 = { package = "actix-web", version = "4" }
maxminddb = "0.22"
maxminddb = "0.23"

[[example]]
name = "maxmind"
Expand Down
6 changes: 3 additions & 3 deletions mozsvc-common/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[package]
name = "mozsvc-common"
version = "0.2.0"
authors = ["Philip Jenvey <pjenvey@underboss.org>"]
description = "Common utilities for Mozilla server side apps"
repository = "https://github.com/mozilla-services/common-rs/"
homepage = "https://github.com/mozilla-services/common-rs/"
license = "MPL-2.0"
edition = "2021"
version = "0.2.0"
edition.workspace = true
license.workspace = true

[dependencies]
lazy_static = "1.0"
Expand Down
12 changes: 6 additions & 6 deletions tracing-actix-web-mozlog/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
[package]
name = "tracing-actix-web-mozlog"
description = "Support for tracing in actix-web apps that target Mozilla's MozLog"
license = "MPL-2.0"
version = "0.5.0"
edition = "2021"
version = "0.5.1"
documentation = "https://docs.rs/tracing-actix-web-mozlog"
repository = "https://github.com/mozilla-services/common-rs"
homepage = "https://github.com/mozilla-services/common-rs/tree/master/tracing-actix-web-mozlog"
license.workspace = true
edition.workspace = true

[dependencies]
gethostname = "^0.2"
gethostname = "^0.4"
serde = { version = "^1", features = ["derive"] }
serde_json = "^1"
tracing = "^0.1"
tracing-bunyan-formatter = "^0.3"
tracing-subscriber = "^0.3"
actix-web = { version = "4", default-features = false }
tracing-actix-web = { version = "0.5", default-features = false }
tracing-actix-web = { version = "0.7", default-features = false }
futures-util = "^0.3"
tracing-futures = { version = "^0.2", features = ["std-future"] }

[dev-dependencies]
actix-web = { version = "4", default-features = false, features = ["macros"] }
maplit = "^1"
pretty_assertions = "^1.2"
jsonschema = "^0.15"
jsonschema = "^0.17"
lazy_static = "^1.4"
actix-rt = "^2.2.0"
12 changes: 6 additions & 6 deletions tracing-actix-web-mozlog/src/middleware.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ impl RootSpanBuilder for MozLogRootSpanBuilder {
);

if let Some(user_agent) = request.headers().get("User-Agent") {
span.record("agent", &user_agent.to_str().unwrap_or("<bad_utf8>"));
span.record("agent", user_agent.to_str().unwrap_or("<bad_utf8>"));
}

span
Expand All @@ -183,14 +183,14 @@ impl RootSpanBuilder for MozLogRootSpanBuilder {
Ok(response) => {
if let Some(req_start) = response.request().extensions().get::<RequestStart>() {
let elapsed = req_start.0.elapsed();
span.record("t", &(elapsed.as_millis() as u32));
span.record("t_ns", &(elapsed.as_nanos() as u64));
span.record("t", elapsed.as_millis() as u32);
span.record("t_ns", elapsed.as_nanos() as u64);
}

if let Some(error) = response.response().error() {
handle_error(span, error);
} else {
span.record("code", &response.response().status().as_u16());
span.record("code", response.response().status().as_u16());
response.status();
}
}
Expand All @@ -205,7 +205,7 @@ impl RootSpanBuilder for MozLogRootSpanBuilder {
fn handle_error(span: Span, error: &actix_web::Error) {
let response_error = error.as_response_error();
let status = response_error.status_code();
span.record("errno", &1);
span.record("errno", 1);
span.record("msg", &tracing::field::display(response_error));
span.record("code", &status.as_u16());
span.record("code", status.as_u16());
}