From 0b220255724020daea18ddb559f5edf3fdb1621b Mon Sep 17 00:00:00 2001 From: Stefan Boberg Date: Wed, 25 Oct 2023 12:21:51 +0200 Subject: statsd metrics reporting (#496) added support for reporting metrics via statsd style UDP messaging, which is supported by many monitoring solution providers this change adds reporting only of three cache related metrics (hit/miss/put) but this should be extended to include more metrics after additional evaluation --- src/zenserver/config.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/zenserver/config.cpp') diff --git a/src/zenserver/config.cpp b/src/zenserver/config.cpp index 81b1dcfe2..ca438fe38 100644 --- a/src/zenserver/config.cpp +++ b/src/zenserver/config.cpp @@ -799,6 +799,11 @@ ParseConfigFile(const std::filesystem::path& Path, LuaOptions.AddOption("trace.host"sv, ServerOptions.TraceHost, "tracehost"sv); LuaOptions.AddOption("trace.file"sv, ServerOptions.TraceFile, "tracefile"sv); + ////// stats + LuaOptions.AddOption("stats.enable"sv, ServerOptions.StatsConfig.Enabled); + LuaOptions.AddOption("stats.host"sv, ServerOptions.StatsConfig.StatsdHost); + LuaOptions.AddOption("stats.port"sv, ServerOptions.StatsConfig.StatsdPort); + ////// cache LuaOptions.AddOption("cache.enable"sv, ServerOptions.StructuredCacheConfig.Enabled); LuaOptions.AddOption("cache.writelog"sv, ServerOptions.StructuredCacheConfig.WriteLogEnabled, "cache-write-log"); @@ -1299,6 +1304,13 @@ ParseCliOptions(int argc, char* argv[], ZenServerOptions& ServerOptions) cxxopts::value>(BucketConfigs), ""); + options.add_option("stats", + "", + "statsd", + "", + cxxopts::value(ServerOptions.StatsConfig.Enabled)->default_value("false"), + "Enable statsd reporter (localhost:8125)"); + try { auto result = options.parse(argc, argv); -- cgit v1.2.3