Skip to content

Commit e33b3de

Browse files
LecrisUTHelmut K. C. Tessarek
andauthored
chore(deps): Update some packages realated to ring and aws-lc (#2991)
After `aws-lc-rs 0.15` it seems the illumos issue is resolved, so reviving the `metrics` et.al. update PR, specifically: - Update `metrics` to 0.24 and `metrics-exporter-prometheus` to 0.17 - Drop the `ring` feature from `rustls` - Update `reqwest` to 0.12 (dropping `rustls 0.21` from the lock file) There still seem to be `ring` dependencies, but not sure if these can be dropped --------- Co-authored-by: Helmut K. C. Tessarek <[email protected]>
1 parent 09230fd commit e33b3de

File tree

10 files changed

+254
-400
lines changed

10 files changed

+254
-400
lines changed

Cargo.lock

Lines changed: 234 additions & 380 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ version = "0.3"
5151
features = ["ansi", "fmt", "registry", "env-filter"]
5252

5353
[workspace.dependencies.reqwest]
54-
version = "0.11"
54+
version = "0.12"
5555
features = ["json", "rustls-tls-native-roots"]
5656
default-features = false
5757

crates/atuin-server-postgres/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ serde = { workspace = true }
2020
sqlx = { workspace = true }
2121
async-trait = { workspace = true }
2222
uuid = { workspace = true }
23-
metrics = "0.21.1"
23+
metrics = "0.24"
2424
futures-util = "0.3"
2525
rand.workspace = true

crates/atuin-server-sqlite/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ serde = { workspace = true }
2020
sqlx = { workspace = true, features = ["sqlite", "regexp"] }
2121
async-trait = { workspace = true }
2222
uuid = { workspace = true }
23-
metrics = "0.21.1"
23+
metrics = "0.24"
2424
futures-util = "0.3"

crates/atuin-server/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ rand = { workspace = true }
2424
tokio = { workspace = true }
2525
async-trait = { workspace = true }
2626
axum = "0.7"
27-
axum-server = { version = "0.7", features = ["tls-rustls-no-provider"] }
27+
axum-server = { version = "0.7", features = ["tls-rustls"] }
2828
fs-err = { workspace = true }
2929
tower = { workspace = true }
3030
tower-http = { version = "0.6", features = ["trace"] }
3131
reqwest = { workspace = true }
32-
rustls = { version = "0.23", features = ["ring"], default-features = false }
32+
rustls = { version = "0.23"}
3333
argon2 = "0.5"
3434
semver = { workspace = true }
35-
metrics-exporter-prometheus = "0.12.1"
36-
metrics = "0.21.1"
35+
metrics-exporter-prometheus = "0.17"
36+
metrics = "0.24"
3737
postmark = {version= "0.11", features=["reqwest", "reqwest-rustls-tls"]}

crates/atuin-server/src/handlers/history.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ pub async fn list<DB: Database>(
6565

6666
if req.sync_ts.unix_timestamp_nanos() < 0 || req.history_ts.unix_timestamp_nanos() < 0 {
6767
error!("client asked for history from < epoch 0");
68-
counter!("atuin_history_epoch_before_zero", 1);
68+
counter!("atuin_history_epoch_before_zero").increment(1);
6969

7070
return Err(
7171
ErrorResponse::reply("asked for history from before epoch 0")
@@ -95,7 +95,7 @@ pub async fn list<DB: Database>(
9595
user.id
9696
);
9797

98-
counter!("atuin_history_returned", history.len() as u64);
98+
counter!("atuin_history_returned").increment(history.len() as u64);
9999

100100
Ok(Json(SyncHistoryResponse { history }))
101101
}
@@ -131,7 +131,7 @@ pub async fn add<DB: Database>(
131131
let State(AppState { database, settings }) = state;
132132

133133
debug!("request to add {} history items", req.len());
134-
counter!("atuin_history_uploaded", req.len() as u64);
134+
counter!("atuin_history_uploaded").increment(req.len() as u64);
135135

136136
let mut history: Vec<NewHistory> = req
137137
.into_iter()
@@ -151,7 +151,7 @@ pub async fn add<DB: Database>(
151151
// Don't return an error here. We want to insert as much of the
152152
// history list as we can, so log the error and continue going.
153153
if !keep {
154-
counter!("atuin_history_too_long", 1);
154+
counter!("atuin_history_too_long").increment(1);
155155

156156
tracing::warn!(
157157
"history too long, got length {}, max {}",

crates/atuin-server/src/handlers/user.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ pub async fn register<DB: Database>(
146146
.await;
147147
}
148148

149-
counter!("atuin_users_registered", 1);
149+
counter!("atuin_users_registered").increment(1);
150150

151151
match db.add_session(&new_session).await {
152152
Ok(_) => Ok(Json(RegisterResponse { session: token })),
@@ -173,7 +173,7 @@ pub async fn delete<DB: Database>(
173173
.with_status(StatusCode::INTERNAL_SERVER_ERROR));
174174
};
175175

176-
counter!("atuin_users_deleted", 1);
176+
counter!("atuin_users_deleted").increment(1);
177177

178178
Ok(Json(DeleteUserResponse {}))
179179
}

crates/atuin-server/src/handlers/v0/record.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ pub async fn post<DB: Database>(
2525
"request to add records"
2626
);
2727

28-
counter!("atuin_record_uploaded", records.len() as u64);
28+
counter!("atuin_record_uploaded").increment(records.len() as u64);
2929

3030
let keep = records
3131
.iter()
3232
.all(|r| r.data.data.len() <= settings.max_record_size || settings.max_record_size == 0);
3333

3434
if !keep {
35-
counter!("atuin_record_too_large", 1);
35+
counter!("atuin_record_too_large").increment(1);
3636

3737
return Err(
3838
ErrorResponse::reply("could not add records; record too large")
@@ -108,7 +108,7 @@ pub async fn next<DB: Database>(
108108
}
109109
};
110110

111-
counter!("atuin_record_downloaded", records.len() as u64);
111+
counter!("atuin_record_downloaded").increment(records.len() as u64);
112112

113113
Ok(Json(records))
114114
}

crates/atuin-server/src/handlers/v0/store.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ pub async fn delete<DB: Database>(
2424
}) = state;
2525

2626
if let Err(e) = database.delete_store(&user).await {
27-
counter!("atuin_store_delete_failed", 1);
27+
counter!("atuin_store_delete_failed").increment(1);
2828
error!("failed to delete store {e:?}");
2929

3030
return Err(ErrorResponse::reply("failed to delete store")
3131
.with_status(StatusCode::INTERNAL_SERVER_ERROR));
3232
}
3333

34-
counter!("atuin_store_deleted", 1);
34+
counter!("atuin_store_deleted").increment(1);
3535

3636
Ok(())
3737
}

crates/atuin-server/src/metrics.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ pub async fn track_metrics(req: Request, next: Next) -> impl IntoResponse {
4848
("status", status),
4949
];
5050

51-
metrics::increment_counter!("http_requests_total", &labels);
52-
metrics::histogram!("http_requests_duration_seconds", latency, &labels);
51+
metrics::counter!("http_requests_total", &labels).increment(1);
52+
metrics::histogram!("http_requests_duration_seconds", &labels).record(latency);
5353

5454
response
5555
}

0 commit comments

Comments
 (0)