This is an automated email from the git hooks/post-receive script.
dgoulet pushed a change to branch main in repository tor.
from 6bf56ac301 Merge branch 'tor-gitlab/mr/703' new 0222fc4d71 add new metrics entry for cert expiration new 0c634999c1 don't emit key expiration metric instead of setting it to zero new 21ec9017f6 Merge branch 'tor-gitlab/mr/698' new 8eae9f17ae metrics: Add ticket 40546 changes file and code fix
The 4 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference.
Summary of changes: changes/ticket40546 | 3 +++ src/feature/relay/relay_metrics.c | 29 +++++++++++++++++++++++++++++ src/feature/relay/relay_metrics.h | 2 ++ 3 files changed, 34 insertions(+) create mode 100644 changes/ticket40546
This is an automated email from the git hooks/post-receive script.
dgoulet pushed a commit to branch main in repository tor.
commit 0222fc4d714c709fa8a0cee1227805a0e23b18d9 Author: trinity-1686a trinity@deuxfleurs.fr AuthorDate: Sun Mar 5 19:43:09 2023 +0100
add new metrics entry for cert expiration --- src/feature/relay/relay_metrics.c | 32 ++++++++++++++++++++++++++++++++ src/feature/relay/relay_metrics.h | 2 ++ 2 files changed, 34 insertions(+)
diff --git a/src/feature/relay/relay_metrics.c b/src/feature/relay/relay_metrics.c index cdf34a3404..2e68475f29 100644 --- a/src/feature/relay/relay_metrics.c +++ b/src/feature/relay/relay_metrics.c @@ -32,8 +32,10 @@ #include "feature/nodelist/nodelist.h" #include "feature/nodelist/node_st.h" #include "feature/nodelist/routerstatus_st.h" +#include "feature/nodelist/torcert.h" #include "feature/relay/relay_metrics.h" #include "feature/relay/router.h" +#include "feature/relay/routerkeys.h" #include "feature/stats/rephist.h"
#include <event2/dns.h> @@ -55,6 +57,7 @@ static void fill_streams_values(void); static void fill_relay_flags(void); static void fill_tcp_exhaustion_values(void); static void fill_traffic_values(void); +static void fill_signing_cert_expiry(void);
/** The base metrics that is a static array of metrics added to the metrics * store. @@ -174,6 +177,13 @@ static const relay_metrics_entry_t base_metrics[] = .help = "Total number of circuits", .fill_fn = fill_circuits_values, }, + { + .key = RELAY_METRICS_SIGNING_CERT_EXPIRY, + .type = METRICS_TYPE_GAUGE, + .name = METRICS_NAME(relay_signing_cert_expiry_timestamp), + .help = "Timestamp at which the current online keys will expire", + .fill_fn = fill_signing_cert_expiry, + }, }; static const size_t num_base_metrics = ARRAY_LENGTH(base_metrics);
@@ -991,6 +1001,28 @@ fill_oom_values(void) metrics_store_entry_update(sentry, oom_stats_n_bytes_removed_hsdir); }
+/** Fill function for the RELAY_METRICS_SIGNING_CERT_EXPIRY metrics. */ +static void +fill_signing_cert_expiry(void) +{ + metrics_store_entry_t *sentry; + const tor_cert_t *signing_key; + const relay_metrics_entry_t *rentry = + &base_metrics[RELAY_METRICS_SIGNING_CERT_EXPIRY]; + uint64_t valid_until = 0; + + sentry = metrics_store_add(the_store, rentry->type, rentry->name, + rentry->help); + + if (get_options()->OfflineMasterKey) { + signing_key = get_master_signing_key_cert(); + if (signing_key) { + valid_until = signing_key->valid_until; + } + } + metrics_store_entry_update(sentry, valid_until); +} + /** Reset the global store and fill it with all the metrics from base_metrics * and their associated values. * diff --git a/src/feature/relay/relay_metrics.h b/src/feature/relay/relay_metrics.h index 1d2d649d8a..100815051b 100644 --- a/src/feature/relay/relay_metrics.h +++ b/src/feature/relay/relay_metrics.h @@ -47,6 +47,8 @@ typedef enum { RELAY_METRICS_RELAY_FLAGS, /** Numer of circuits. */ RELAY_METRICS_NUM_CIRCUITS, + /** Timestamp at which the current online keys will expire. */ + RELAY_METRICS_SIGNING_CERT_EXPIRY } relay_metrics_key_t;
/** The metadata of a relay metric. */
This is an automated email from the git hooks/post-receive script.
dgoulet pushed a commit to branch main in repository tor.
commit 0c634999c13bdf40843924d54fc3294136774788 Author: trinity-1686a trinity@deuxfleurs.fr AuthorDate: Sun Mar 19 10:31:28 2023 +0100
don't emit key expiration metric instead of setting it to zero --- src/feature/relay/relay_metrics.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/src/feature/relay/relay_metrics.c b/src/feature/relay/relay_metrics.c index 2e68475f29..6ee75f69f0 100644 --- a/src/feature/relay/relay_metrics.c +++ b/src/feature/relay/relay_metrics.c @@ -1009,18 +1009,15 @@ fill_signing_cert_expiry(void) const tor_cert_t *signing_key; const relay_metrics_entry_t *rentry = &base_metrics[RELAY_METRICS_SIGNING_CERT_EXPIRY]; - uint64_t valid_until = 0; - - sentry = metrics_store_add(the_store, rentry->type, rentry->name, - rentry->help);
if (get_options()->OfflineMasterKey) { signing_key = get_master_signing_key_cert(); if (signing_key) { - valid_until = signing_key->valid_until; + sentry = metrics_store_add(the_store, rentry->type, rentry->name, + rentry->help); + metrics_store_entry_update(sentry, signing_key->valid_until); } } - metrics_store_entry_update(sentry, valid_until); }
/** Reset the global store and fill it with all the metrics from base_metrics
This is an automated email from the git hooks/post-receive script.
dgoulet pushed a commit to branch main in repository tor.
commit 21ec9017f60a0f7f9fc04782bc4bab6b836f0758 Merge: 6bf56ac301 0c634999c1 Author: David Goulet dgoulet@torproject.org AuthorDate: Wed May 24 10:40:25 2023 -0400
Merge branch 'tor-gitlab/mr/698'
src/feature/relay/relay_metrics.c | 29 +++++++++++++++++++++++++++++ src/feature/relay/relay_metrics.h | 2 ++ 2 files changed, 31 insertions(+)
This is an automated email from the git hooks/post-receive script.
dgoulet pushed a commit to branch main in repository tor.
commit 8eae9f17ae87e16ab7595544d858e9371d9068c2 Author: David Goulet dgoulet@torproject.org AuthorDate: Wed May 24 10:42:00 2023 -0400
metrics: Add ticket 40546 changes file and code fix
The MR was using an old function definition so the code fix is for that.
Closes #40546
Signed-off-by: David Goulet dgoulet@torproject.org --- changes/ticket40546 | 3 +++ src/feature/relay/relay_metrics.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/changes/ticket40546 b/changes/ticket40546 new file mode 100644 index 0000000000..93f19f74c1 --- /dev/null +++ b/changes/ticket40546 @@ -0,0 +1,3 @@ + o Minor feature (MetricsPort, relay): + - Expose time until online keys expires on the MetricsPort. Closes ticket + 40546. diff --git a/src/feature/relay/relay_metrics.c b/src/feature/relay/relay_metrics.c index 494cfb34dd..5309411804 100644 --- a/src/feature/relay/relay_metrics.c +++ b/src/feature/relay/relay_metrics.c @@ -1014,7 +1014,7 @@ fill_signing_cert_expiry(void) signing_key = get_master_signing_key_cert(); if (signing_key) { sentry = metrics_store_add(the_store, rentry->type, rentry->name, - rentry->help); + rentry->help, 0, NULL); metrics_store_entry_update(sentry, signing_key->valid_until); } }
tor-commits@lists.torproject.org