fix: update DEFAULT_STATSD_HOST

This commit is contained in:
UdjinM6 2024-10-04 22:46:35 +03:00
parent 44d7806478
commit 802efc5efd
No known key found for this signature in database
GPG Key ID: 83592BD1400D58D9
2 changed files with 4 additions and 4 deletions

View File

@ -34,12 +34,12 @@ std::unique_ptr<StatsdClient> g_stats_client;
std::unique_ptr<StatsdClient> InitStatsClient(const ArgsManager& args)
{
auto is_enabled = args.GetBoolArg("-statsenabled", /*fDefault=*/false);
auto host = args.GetArg("-statshost", /*fDefault=*/"");
auto host = args.GetArg("-statshost", /*fDefault=*/DEFAULT_STATSD_HOST);
if (is_enabled && host.empty()) {
// Stats are enabled but host has not been specified, then use
// default host. This is to preserve old behavior.
host = DEFAULT_STATSD_HOST;
// default legacy host. This is to preserve old behavior.
host = "127.0.0.1";
} else if (!host.empty()) {
// Host is specified but stats are not explcitly enabled. Assume
// that if a host has been specified, we want stats enabled. This

View File

@ -19,7 +19,7 @@ class RawSender;
/** Default port used to connect to a Statsd server */
static constexpr uint16_t DEFAULT_STATSD_PORT{8125};
/** Default host assumed to be running a Statsd server */
static const std::string DEFAULT_STATSD_HOST{"127.0.0.1"};
static const std::string DEFAULT_STATSD_HOST{""};
/** Default prefix prepended to Statsd message keys */
static const std::string DEFAULT_STATSD_PREFIX{""};
/** Default suffix appended to Statsd message keys */