diff --git a/docs/docs/UPDATES.md b/docs/docs/UPDATES.md index d1d913b9c3..4a1eb5a626 100644 --- a/docs/docs/UPDATES.md +++ b/docs/docs/UPDATES.md @@ -163,6 +163,8 @@ use danog\MadelineProto\Settings\Database\Redis; use danog\MadelineProto\SimpleEventHandler; use danog\MadelineProto\VoIP; +use function Amp\Socket\SocketAddress\fromString; + // MadelineProto is already loaded if (class_exists(API::class)) { // Otherwise, if a stable version of MadelineProto was installed via composer, load composer autoloader @@ -428,6 +430,29 @@ $settings->getLogger()->setLevel(Logger::LEVEL_ULTRA_VERBOSE); // $settings->setDb((new Postgres)->setDatabase('MadelineProto')->setUsername('daniil')->setPassword('pony')); // $settings->setDb((new Mysql)->setDatabase('MadelineProto')->setUsername('daniil')->setPassword('pony')); +// You can also enable collection of additional prometheus metrics. +// $settings->getMetrics()->setEnablePrometheusCollection(true); + +// You can also enable collection of additional memory profiling metrics. +// Note: you must also set the MEMPROF_PROFILE=1 environment variable or GET parameter. +// $settings->getMetrics()->setEnableMemprofCollection(true); + +// Metrics can be returned by an autoconfigured http://127.0.0.1:12345 HTTP server. +// +// Endpoints: +// +// /metrics - Prometheus metrics +// /debug/pprof - PProf memory profile for pyroscope +// +// $settings->getMetrics()->setMetricsBindTo(fromString("127.0.0.1:12345")); + +// Metrics can also be returned by the current script via web, if called with a specific query string: +// +// ?metrics - Prometheus metrics +// ?pprof - PProf memory profile for pyroscope +// +// $settings->getMetrics()->setReturnMetricsFromStartAndLoop(true); + // For users or bots MyEventHandler::startAndLoop('bot.madeline', $settings);