Skip to content
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

Downgrade various logs to DEBUG level #2557

Merged
merged 3 commits into from
Jan 29, 2024
Merged
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
24 changes: 12 additions & 12 deletions aggregator/src/aggregator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ use std::{
time::{Duration as StdDuration, Instant},
};
use tokio::{sync::Mutex, try_join};
use tracing::{debug, info, trace_span, warn};
use tracing::{debug, info, trace_span, warn, Level};
use url::Url;

pub mod accumulator;
Expand Down Expand Up @@ -699,7 +699,7 @@ impl<C: Clock> Aggregator<C> {
}

/// Opts in or out of a taskprov task.
#[tracing::instrument(skip(self, aggregator_auth_token), err)]
#[tracing::instrument(skip(self, aggregator_auth_token), err(level = Level::DEBUG))]
async fn taskprov_opt_in(
&self,
peer_role: &Role,
Expand Down Expand Up @@ -772,7 +772,7 @@ impl<C: Clock> Aggregator<C> {
/// Validate and authorize a taskprov request. Returns values necessary for determining whether
/// we can opt into the task. This function might return an opt-out error for conditions that
/// are relevant for all DAP workflows (e.g. task expiration).
#[tracing::instrument(skip(self, aggregator_auth_token), err)]
#[tracing::instrument(skip(self, aggregator_auth_token), err(level = Level::DEBUG))]
async fn taskprov_authorize_request(
&self,
peer_role: &Role,
Expand Down Expand Up @@ -1285,7 +1285,7 @@ macro_rules! vdaf_ops_dispatch {
}

impl VdafOps {
#[tracing::instrument(skip_all, fields(task_id = ?task.id()), err)]
#[tracing::instrument(skip_all, fields(task_id = ?task.id()), err(level = Level::DEBUG))]
async fn handle_upload<C: Clock>(
&self,
clock: &C,
Expand Down Expand Up @@ -1336,7 +1336,7 @@ impl VdafOps {
#[tracing::instrument(
skip(self, datastore, global_hpke_keypairs, aggregate_step_failure_counter, task, req_bytes),
fields(task_id = ?task.id()),
err
err(level = Level::DEBUG)
)]
async fn handle_aggregate_init<C: Clock>(
&self,
Expand Down Expand Up @@ -1387,7 +1387,7 @@ impl VdafOps {
#[tracing::instrument(
skip(self, datastore, aggregate_step_failure_counter, task, req, request_hash),
fields(task_id = ?task.id()),
err
err(level = Level::DEBUG)
)]
async fn handle_aggregate_continue<C: Clock>(
&self,
Expand Down Expand Up @@ -1433,7 +1433,7 @@ impl VdafOps {
}
}

#[tracing::instrument(skip(self, datastore), fields(task_id = ?task.id()), err)]
#[tracing::instrument(skip(self, datastore), fields(task_id = ?task.id()), err(level = Level::DEBUG))]
async fn handle_aggregate_delete<C: Clock>(
&self,
datastore: &Datastore<C>,
Expand Down Expand Up @@ -2439,7 +2439,7 @@ impl VdafOps {
#[tracing::instrument(
skip(self, datastore, task, collection_req_bytes),
fields(task_id = ?task.id()),
err
err(level = Level::DEBUG)
)]
async fn handle_create_collection_job<C: Clock>(
&self,
Expand Down Expand Up @@ -2741,7 +2741,7 @@ impl VdafOps {
/// Handle GET requests to the leader's `tasks/{task-id}/collection_jobs/{collection-job-id}`
/// endpoint. The return value is an encoded `CollectResp<Q>`.
/// <https://www.ietf.org/archive/id/draft-ietf-ppm-dap-07.html#name-collecting-results>
#[tracing::instrument(skip(self, datastore, task), fields(task_id = ?task.id()), err)]
#[tracing::instrument(skip(self, datastore, task), fields(task_id = ?task.id()), err(level = Level::DEBUG))]
async fn handle_get_collection_job<C: Clock>(
&self,
datastore: &Datastore<C>,
Expand Down Expand Up @@ -2918,7 +2918,7 @@ impl VdafOps {
}
}

#[tracing::instrument(skip(self, datastore, task), fields(task_id = ?task.id()), err)]
#[tracing::instrument(skip(self, datastore, task), fields(task_id = ?task.id()), err(level = Level::DEBUG))]
async fn handle_delete_collection_job<C: Clock>(
&self,
datastore: &Datastore<C>,
Expand Down Expand Up @@ -3001,7 +3001,7 @@ impl VdafOps {
#[tracing::instrument(
skip(self, datastore, clock, task, req_bytes),
fields(task_id = ?task.id()),
err
err(level = Level::DEBUG)
)]
async fn handle_aggregate_share<C: Clock>(
&self,
Expand Down Expand Up @@ -3311,7 +3311,7 @@ struct RequestBody<T> {
http_request_duration_histogram,
),
fields(url = %url),
err,
err(level = Level::DEBUG),
)]
async fn send_request_to_helper<T: Encode>(
http_client: &Client,
Expand Down
9 changes: 7 additions & 2 deletions aggregator/src/aggregator/http_handlers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ impl Handler for Error {
async fn run(&self, mut conn: Conn) -> Conn {
let error_code = self.error_code();
conn.set_state(ErrorCode(error_code));
warn!(error_code, error=?self, "Error handling endpoint");
match self {
let conn = match self {
Error::InvalidConfiguration(_) => conn.with_status(Status::InternalServerError),
Error::MessageDecode(_) => conn
.with_problem_document(&ProblemDocument::new_dap(DapProblemType::InvalidMessage)),
Expand Down Expand Up @@ -154,7 +153,13 @@ impl Handler for Error {
&ProblemDocument::new_dap(DapProblemType::InvalidTask).with_task_id(task_id),
),
Error::DifferentialPrivacy(_) => conn.with_status(Status::InternalServerError),
};

if matches!(conn.status(), Some(status) if status.is_server_error()) {
warn!(error_code, error=?self, "Error handling endpoint");
}

conn
}
}

Expand Down
Loading
Loading