Skip to content

Commit 493fdaf

Browse files
committed
Always set transaction name
Only set custom parameters when the module is enabled in the MAP
1 parent 381f5d1 commit 493fdaf

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

app/code/Magento/GraphQl/Model/Query/Logger/NewRelic.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,16 @@ public function __construct(
4141
*/
4242
public function execute(array $queryDetails)
4343
{
44+
$transactionName = $queryDetails[LoggerInterface::OPERATION_NAMES] ?: '';
45+
$this->newRelicWrapper->setTransactionName('GraphQL-' . $transactionName);
46+
47+
if (!$this->config->isNewRelicEnabled()) {
48+
return;
49+
}
50+
4451
foreach ($queryDetails as $key => $value) {
4552
$this->newRelicWrapper->addCustomParameter($key, $value);
4653
}
4754

48-
$transactionName = $queryDetails[LoggerInterface::OPERATION_NAMES] ?: '';
49-
50-
$this->newRelicWrapper->setTransactionName('GraphQL-' . $transactionName);
5155
}
5256
}

0 commit comments

Comments
 (0)