summaryrefslogtreecommitdiff
path: root/src/feature/hs/hs_metrics.h
diff options
context:
space:
mode:
authorGabriela Moldovan <gabi@torproject.org>2023-02-10 12:20:23 +0000
committerGabriela Moldovan <gabi@torproject.org>2023-02-16 18:54:30 +0000
commitdb4c4d656a8d3cc58bd6179c8dedd3f3b5f68dd6 (patch)
treea972533634b7dc888dafacd1d47026d3663dcf00 /src/feature/hs/hs_metrics.h
parent482ce87a8de23bf6d29ec55c1c7b9399dbdfac3b (diff)
downloadtor-db4c4d656a8d3cc58bd6179c8dedd3f3b5f68dd6.tar.gz
tor-db4c4d656a8d3cc58bd6179c8dedd3f3b5f68dd6.zip
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 <gabi@torproject.org>
Diffstat (limited to 'src/feature/hs/hs_metrics.h')
-rw-r--r--src/feature/hs/hs_metrics.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/feature/hs/hs_metrics.h b/src/feature/hs/hs_metrics.h
index 2e0fa5048d..db02fefcea 100644
--- a/src/feature/hs/hs_metrics.h
+++ b/src/feature/hs/hs_metrics.h
@@ -28,13 +28,17 @@ void hs_metrics_update_by_ident(const hs_metrics_key_t key,
const ed25519_public_key_t *ident_pk,
const uint16_t port, int64_t n);
void hs_metrics_update_by_service(const hs_metrics_key_t key,
- hs_service_t *service, const uint16_t port,
- int64_t n);
+ const hs_service_t *service,
+ uint16_t port, int64_t n);
/** New introducion request received. */
#define hs_metrics_new_introduction(s) \
hs_metrics_update_by_service(HS_METRICS_NUM_INTRODUCTIONS, (s), 0, 1)
+/** Introducion request rejected. */
+#define hs_metrics_reject_intro_req(s) \
+ hs_metrics_update_by_service(HS_METRICS_NUM_REJECTED_INTRO_REQ, (s), 0, 1)
+
/** Number of bytes written to the application from the service. */
#define hs_metrics_app_write_bytes(i, port, n) \
hs_metrics_update_by_ident(HS_METRICS_APP_WRITE_BYTES, (i), (port), (n))
@@ -48,6 +52,10 @@ void hs_metrics_update_by_service(const hs_metrics_key_t key,
#define hs_metrics_new_established_rdv(s) \
hs_metrics_update_by_service(HS_METRICS_NUM_ESTABLISHED_RDV, (s), 0, 1)
+/** New rendezvous circuit failure. */
+#define hs_metrics_failed_rdv(i) \
+ hs_metrics_update_by_ident(HS_METRICS_NUM_FAILED_RDV, (i), 0, 1)
+
/** Established rendezvous closed. This is called when the circuit in
* REND_JOINED state is marked for close. */
#define hs_metrics_close_established_rdv(i) \