aKode fase 5: rinomina interna (crate akode-*, akode-rs/, akode-cli/, binario akode, AKODE_*, ~/.akode, snapshot)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
23
akode-rs/exec-server/src/client_telemetry.rs
Normal file
23
akode-rs/exec-server/src/client_telemetry.rs
Normal file
@@ -0,0 +1,23 @@
|
||||
//! Caller-side RPC attempt counts using the client's protocol method names, independent of tracing.
|
||||
|
||||
use akode_otel::EXEC_SERVER_CLIENT_REQUEST_COUNT_METRIC;
|
||||
use akode_otel::MetricsClient;
|
||||
|
||||
pub(crate) fn record_client_request(metrics: Option<&MetricsClient>, method: &str) {
|
||||
let Some(metrics) = metrics else {
|
||||
return;
|
||||
};
|
||||
// Record before local admission so failures and cancelled calls still count
|
||||
// as attempts. Notifications and responses never enter these call paths.
|
||||
if metrics
|
||||
.counter_with_description(
|
||||
EXEC_SERVER_CLIENT_REQUEST_COUNT_METRIC,
|
||||
"Total number of client-side exec-server RPC attempts, including local failures.",
|
||||
/*inc*/ 1,
|
||||
&[("method", method)],
|
||||
)
|
||||
.is_err()
|
||||
{
|
||||
tracing::warn!("failed to emit exec-server client request counter");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user