]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
stats: Allow empty event exporters when registering metrics
authorKarl Fleischmann <karl.fleischmann@open-xchange.com>
Thu, 15 Jun 2023 11:32:11 +0000 (13:32 +0200)
committerKarl Fleischmann <karl.fleischmann@open-xchange.com>
Thu, 15 Jun 2023 11:32:11 +0000 (13:32 +0200)
src/stats/stats-metrics.c

index 50e68290aa7e88b7fc15ad4f81c4c4e88c714f01..7eadcaed02cc91fc69f8b0658ba339a2f4bf85a8 100644 (file)
@@ -193,6 +193,10 @@ stats_metrics_check_for_exporter(struct stats_metrics *metrics, const char *name
 {
        struct exporter *exporter;
 
+       /* Allow registering metrics with empty/missing exporters. */
+       if (name[0] == '\0')
+               return TRUE;
+
        if (!array_is_created(&metrics->exporters))
                return FALSE;