From 429f7f3c8e476202ac44e18f71a33dcfa66361f2 Mon Sep 17 00:00:00 2001 From: daflyinbed <1677759063@qq.com> Date: Sat, 27 Apr 2024 14:22:02 +0000 Subject: [PATCH] feat: add sentry transaction --- includes/MediaWiki.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/includes/MediaWiki.php b/includes/MediaWiki.php index d88c4df38532e..198b4ccd89844 100644 --- a/includes/MediaWiki.php +++ b/includes/MediaWiki.php @@ -558,6 +558,10 @@ private function performAction( Article $article, Title $requestTitle ) { * Run the current MediaWiki instance; index.php just calls this */ public function run() { + $transactionContext = \Sentry\Tracing\TransactionContext::make()->setName('run'); + + // Start the transaction + $transaction = \Sentry\startTransaction($transactionContext); try { $this->main(); } catch ( Exception $e ) { @@ -583,7 +587,7 @@ public function run() { // Type errors and such: at least handle it now and clean up the LBFactory state MWExceptionHandler::handleException( $e, MWExceptionHandler::CAUGHT_BY_ENTRYPOINT ); } - + $transaction->finish(); $this->doPostOutputShutdown(); }