aboutsummaryrefslogtreecommitdiff
path: root/src/feature/stats/rephist.c
AgeCommit message (Collapse)Author
2024-01-30metrics: Add new relay metrics to MetricsPortDavid Goulet
This commit adds the total number of DROP cell seen, the total number of DESTROY cell received and the total number of protocol violation that lead to a circuit close. Closes #40816 Signed-off-by: David Goulet <dgoulet@torproject.org>
2023-09-19Handle ntor and ntor_v3 individually in rephist and for MetricsPort.Alexander Færøy
This patch should not mess with the DoS protection here. Fixes tpo/core/tor#40638.
2023-05-25Removed getter abstraction and moved from rephist to relay_metrics.friendly73
2023-05-25Fixed est intro getter using wrong arrayfriendly73
2023-05-25Added INTRO and REND metrics for relay.friendly73
2022-11-08Merge branch 'maint-0.4.7'David Goulet
2022-11-03metrics: Add connection socket family to metricsDavid Goulet
Adds either ipv4 or ipv6 to the "tor_relay_connections_total" stats. Closes #40710 Signed-off-by: David Goulet <dgoulet@torproject.org>
2022-10-27Merge branch 'maint-0.4.7'David Goulet
2022-10-27metrics: Fix naming and documentationDavid Goulet
After nickm's review, minor changes to names and comments. Related to #40194 Signed-off-by: David Goulet <dgoulet@torproject.org>
2022-10-26rephist: Track number of streams seen per typeDavid Goulet
Related to #40194 Signed-off-by: David Goulet <dgoulet@torproject.org>
2022-10-12Merge branch 'maint-0.4.7'David Goulet
2022-10-12relay: Add number of rejected connections to MetricsPortDavid Goulet
Related to #40194 Signed-off-by: David Goulet <dgoulet@torproject.org>
2022-10-12conn: Keep stats of opened and closed connectionsDavid Goulet
Related to #40194 Signed-off-by: David Goulet <dgoulet@torproject.org>
2022-07-05fix easy typosRoger Dingledine
2022-03-15rephist: Introduce a fraction and period for overload onionskinDavid Goulet
This code was heavily reused from the previous DNS timeout work done in ticket #40491 that was removed afterall from our code. Closes #40560 Signed-off-by: David Goulet <dgoulet@torproject.org>
2022-02-22Handle other places that use onion handshake type valuesMike Perry
We want ntor and ntorv3 to use the same queues and stats.
2021-12-13relay: Change DNS timeout label on MetricsPortDavid Goulet
Change it from "timeout" to "tor_timeout" in order to indicate that the DNS timeout is one from tor's DNS threshold and not the DNS server itself. Fixes #40527 Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-12-13Merge branch 'ticket40527_046_01' into ticket40527_047_01David Goulet
2021-12-13relay: Don't make DNS timeout trigger an overloadDavid Goulet
Tor has configure libevent to attempt up to 3 times a DNS query for a maximum of 5 seconds each. Once that 5 seconds has elapsed, it consider the query "Timed Out" but tor only gets a timeout if all 3 attempts have failed. For example, using Unbound, it has a much higher threshold of timeout. It is well defined in https://www.nlnetlabs.nl/documentation/unbound/info-timeout/ and has some complexity to it. But the gist is that if it times out, it will be much more than 5 seconds. And so the Tor DNS timeouts are more of a "UX issue" rather than a "network issue". For this reason, we are removing this metric from the overload general signal. See https://gitlab.torproject.org/tpo/network-health/team/-/issues/139 for more information. Fixes #40527 Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-10-20relay: For metrics, don't report DNS errors by query typeDavid Goulet
This is due to the libevent bug https://github.com/libevent/libevent/issues/1219 that fails to return back the DNS record type on error. And so, the MetricsPort now only reports the errors as a global counter and not a per record type. Closes #40490 Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-10-20relay: Overload state on DNS timeout is now X% over Y secsDavid Goulet
With this commit, we will only report a general overload state if we've seen more than X% of DNS timeout errors over Y seconds. Previous behavior was to report when a single timeout occured which is really too small of a threshold. The value X is a consensus parameters called "overload_dns_timeout_scale_percent" which is a scaled percentage (factor of 1000) so we can represent decimal points for X like 0.5% for instance. Its default is 1000 which ends up being 1%. The value Y is a consensus parameters called "overload_dns_timeout_period_secs" which is the time period for which will gather DNS errors and once over, we assess if that X% has been reached ultimately triggering a general overload signal. Closes #40491 Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-10-20relay: Overload state on DNS timeout is now X% over Y secsDavid Goulet
With this commit, we will only report a general overload state if we've seen more than X% of DNS timeout errors over Y seconds. Previous behavior was to report when a single timeout occured which is really too small of a threshold. The value X is a consensus parameters called "overload_dns_timeout_scale_percent" which is a scaled percentage (factor of 1000) so we can represent decimal points for X like 0.5% for instance. Its default is 1000 which ends up being 1%. The value Y is a consensus parameters called "overload_dns_timeout_period_secs" which is the time period for which will gather DNS errors and once over, we assess if that X% has been reached ultimately triggering a general overload signal. Closes #40491 Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-06-28Merge remote-tracking branch 'tor-gitlab/mr/385'George Kadianakis
2021-05-20Fix the fencepost issue when we check stability_last_downratedNeel Chauhan
2021-05-12rephist: Add a counter for the onioniskins statsDavid Goulet
Current counters are reset every heartbeat. This commit adds two counters for the assigned and dropped onionskins that are not reset so they can be exported onto the MetricsPort. Closes #40387 Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-05-12relay: We might be noting down an unknown DNS error typeDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-05-12relay: Add TCP port exhaustion metricsDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-05-12dns: Gather DNS request statisticsDavid Goulet
We now keep track of all errors and total number of request seen. This is so we can expose those values to the MetricsPort to help Exit operators monitor the DNS requests and failures. Related to #40367. Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-05-12relay: Add the global connection limit metricsDavid Goulet
This emits two events (read and write) of the total number that the global connection limit was reached. Related to #40367 Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-05-12relay: Add the onionskins processing metricsDavid Goulet
With this commit, a relay now emits metrics event on the MetricsPort related to how many onionskins were handled (processed or dropped) for each handshake type. Related to #40367 Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-04-13relay: Move "overload-general" from extra-info to server descriptor.Alexander Færøy
Fixes #40364 Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-03-18Terminate rep_hist_get_overload_stats_lines() with an NL.tor-0.4.6.1-alphaNick Mathewson
We use it in router.c, where chunks are joined with "", not with NL... so leaving off the terminating NL will lead to an unparseable extrainfo. Found by toralf. Bug not in any released Tor.
2021-03-17Fix compiler warning about signed/unsigned conversion.George Kadianakis
``` src/feature/stats/rephist.c: In function ‘overload_happened_recently’: src/feature/stats/rephist.c:215:21: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare] if (overload_time > approx_time() - 3600 * n_hours) { ``` from https://gitlab.torproject.org/tpo/core/tor/-/issues/40341#note_2729364
2021-03-17Merge branch 'mr/334'George Kadianakis
2021-03-17Rate-limit counter should increase once per minute.George Kadianakis
2021-03-17Implement backbone of overload statistics.George Kadianakis
- Implement overload statistics structure. - Implement function that keeps track of overload statistics. - Implement function that writes overload statistics to descriptor. - Unittest for the whole logic.
2021-03-12Update copyrights to 2021, using "make update-copyright"Nick Mathewson
2021-02-19hs: Remove v2 statsDavid Goulet
We still keep v2 rendezvous stats since we will allow them until the network has entirely phased out. Related to #40266 Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-11-23Revert HSv3 stats string formatting to its old %u self.George Kadianakis
The rest of rephist.c is doing the same kind of unsigned casting. For example see rep_hist_format_buffer_stats() and rep_hist_format_exit_stats(). The previous switch to %ld made Appveyor fail: https://ci.appveyor.com/project/torproject/tor/builds/36118502
2020-11-17Merge branch 'tor-gitlab/mr/182' into masterDavid Goulet
2020-11-12Fix typos.Samanta Navarro
Typos found with codespell. Please keep in mind that this should have impact on actual code and must be carefully evaluated: src/core/or/lttng_circuit.inc - ctf_enum_value("CONTROLER", CIRCUIT_PURPOSE_CONTROLLER) + ctf_enum_value("CONTROLLER", CIRCUIT_PURPOSE_CONTROLLER)
2020-11-03Add more docs about the HSv3 stat collection period.George Kadianakis
2020-11-03Improve string formatting in rep_hist_format_hs_stats().George Kadianakis
2020-11-03Switch v3_onions_seen_this_period to digest256map_t.George Kadianakis
2020-11-03Abstract v2/v3 "format stats to str" logic into a single function.George Kadianakis
2020-11-03Abstract v2/v3 "write stats to file" logic into a single function.George Kadianakis
2020-11-03Write unittests for v3 metrics.George Kadianakis
2020-11-03Introduce v3 stat formatting functions.George Kadianakis
They will be merged with the v2 ones in later commits.
2020-11-03Introduce generic HS stats methods that apply to v2 and v3.George Kadianakis
2020-11-03Implement support for "v3 rend traffic" stat.George Kadianakis