Skip to content

Commit

Permalink
ref(metrics): Tag requests accepted/processed with task name (#1548)
Browse files Browse the repository at this point in the history
  • Loading branch information
loewenheim authored Nov 7, 2024
1 parent 3aad4a9 commit 3d24115
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions crates/symbolicator/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,9 @@ impl RequestService {
}
}

metric!(counter("requests.accepted") += 1);
// Using `task_name` as the tag should be fine, there is only a small
// fixed number of them.
metric!(counter("requests.accepted") += 1, "task" => task_name);

let request_id = RequestId::new(uuid::Uuid::new_v4());
requests
Expand Down Expand Up @@ -479,7 +481,10 @@ impl RequestService {
// We stop counting the request as an in-flight request at this point, even though
// it will stay in the `requests` map for another 90s.
current_requests.fetch_sub(1, Ordering::Relaxed);
metric!(counter("requests.processed") += 1);

// Using `task_name` as the tag should be fine, there is only a small
// fixed number of them.
metric!(counter("requests.processed") += 1, "task" => task_name);

// Wait before removing the channel from the computation map to allow clients to
// poll the status.
Expand Down

0 comments on commit 3d24115

Please sign in to comment.