From db4c4d656a8d3cc58bd6179c8dedd3f3b5f68dd6 Mon Sep 17 00:00:00 2001 From: Gabriela Moldovan Date: Fri, 10 Feb 2023 12:20:23 +0000 Subject: metrics: Add metrics for rendezvous and introduction request failures. This introduces a couple of new service side metrics: * `hs_intro_rejected_intro_req_count`, which counts the number of introduction requests rejected by the hidden service * `hs_rdv_error_count`, which counts the number of rendezvous errors as seen by the hidden service (this number includes the number of circuit establishment failures, failed retries, end-to-end circuit setup failures) Closes #40755. This partially addresses #40717. Signed-off-by: Gabriela Moldovan --- src/core/or/circuituse.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/core/or/circuituse.c') diff --git a/src/core/or/circuituse.c b/src/core/or/circuituse.c index dbeea10821..421d3662af 100644 --- a/src/core/or/circuituse.c +++ b/src/core/or/circuituse.c @@ -51,6 +51,7 @@ #include "feature/hs/hs_client.h" #include "feature/hs/hs_common.h" #include "feature/hs/hs_ident.h" +#include "feature/hs/hs_metrics.h" #include "feature/hs/hs_stats.h" #include "feature/nodelist/describe.h" #include "feature/nodelist/networkstatus.h" @@ -1751,8 +1752,10 @@ circuit_build_failed(origin_circuit_t *circ) circuit_purpose_to_string(TO_CIRCUIT(circ)->purpose)); /* If the path failed on an RP, retry it. */ - if (TO_CIRCUIT(circ)->purpose == CIRCUIT_PURPOSE_S_CONNECT_REND) + if (TO_CIRCUIT(circ)->purpose == CIRCUIT_PURPOSE_S_CONNECT_REND) { + hs_metrics_failed_rdv(&circ->hs_ident->identity_pk); hs_circ_retry_service_rendezvous_point(circ); + } /* In all other cases, just bail. The rest is just failure accounting * that we don't want to do */ @@ -1862,6 +1865,8 @@ circuit_build_failed(origin_circuit_t *circ) "(%s hop failed).", escaped(build_state_get_exit_nickname(circ->build_state)), failed_at_last_hop?"last":"non-last"); + + hs_metrics_failed_rdv(&circ->hs_ident->identity_pk); hs_circ_retry_service_rendezvous_point(circ); break; /* default: -- cgit v1.2.3-54-g00ecf