aboutsummaryrefslogtreecommitdiff
path: root/src/core/or/circuituse.c
diff options
context:
space:
mode:
authorGabriela Moldovan <gabi@torproject.org>2023-02-15 14:52:35 +0000
committerDavid Goulet <dgoulet@torproject.org>2023-03-07 09:46:05 -0500
commit16c6788fbc30cf0a2611dd021d1797931a53a86d (patch)
tree10486dd6918e9c97c85fc1539abe6bfec0f5a3ff /src/core/or/circuituse.c
parent119b84c365da867a6dcb85877f1d13dcf06c59a4 (diff)
downloadtor-16c6788fbc30cf0a2611dd021d1797931a53a86d.tar.gz
tor-16c6788fbc30cf0a2611dd021d1797931a53a86d.zip
metrics: Add a `reason` label to the HS error metrics.
This adds a `reason` label to the `hs_intro_rejected_intro_req_count` and `hs_rdv_error_count` metrics introduced in #40755. Metric look up and intialization is now more a bit more involved. This may be fine for now, but it will become unwieldy if/when we add more labels (and as such will need to be refactored). Also, in the future, we may want to introduce finer grained `reason` labels. For example, the `invalid_introduce2` label actually covers multiple types of errors that can happen during the processing of an INTRODUCE2 cell (such as cell parse errors, replays, decryption errors). Signed-off-by: Gabriela Moldovan <gabi@torproject.org>
Diffstat (limited to 'src/core/or/circuituse.c')
-rw-r--r--src/core/or/circuituse.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/core/or/circuituse.c b/src/core/or/circuituse.c
index 421d3662af..77c5deaafb 100644
--- a/src/core/or/circuituse.c
+++ b/src/core/or/circuituse.c
@@ -1753,7 +1753,8 @@ circuit_build_failed(origin_circuit_t *circ)
/* If the path failed on an RP, retry it. */
if (TO_CIRCUIT(circ)->purpose == CIRCUIT_PURPOSE_S_CONNECT_REND) {
- hs_metrics_failed_rdv(&circ->hs_ident->identity_pk);
+ hs_metrics_failed_rdv(&circ->hs_ident->identity_pk,
+ HS_METRICS_ERR_RDV_PATH);
hs_circ_retry_service_rendezvous_point(circ);
}
@@ -1866,7 +1867,8 @@ circuit_build_failed(origin_circuit_t *circ)
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_metrics_failed_rdv(&circ->hs_ident->identity_pk,
+ HS_METRICS_ERR_RDV_RP_CONN_FAILURE);
hs_circ_retry_service_rendezvous_point(circ);
break;
/* default: