Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NewRelic dependency removed from Graph-Ql #3

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
diff --git a/Model/Query/Logger/NewRelic.php b/Model/Query/Logger/NewRelic.php
deleted file mode 100644
index 55f25c17..00000000
--- a/Model/Query/Logger/NewRelic.php
+++ /dev/null
@@ -1,56 +0,0 @@
-<?php
-/**
- * Copyright © Magento, Inc. All rights reserved.
- * See COPYING.txt for license details.
- */
-
-namespace Magento\GraphQl\Model\Query\Logger;
-
-use Magento\NewRelicReporting\Model\Config;
-use Magento\NewRelicReporting\Model\NewRelicWrapper;
-
-/**
- * Logs GraphQl query data for New Relic
- */
-class NewRelic implements LoggerInterface
-{
- /**
- * @var Config
- */
- private $config;
-
- /**
- * @var NewRelicWrapper
- */
- private $newRelicWrapper;
-
- /**
- * @param Config $config
- * @param NewRelicWrapper $newRelicWrapper
- */
- public function __construct(
- Config $config,
- NewRelicWrapper $newRelicWrapper
- ) {
- $this->config = $config;
- $this->newRelicWrapper = $newRelicWrapper;
- }
-
- /**
- * @inheritdoc
- */
- public function execute(array $queryDetails)
- {
- if (!$this->config->isNewRelicEnabled()) {
- return;
- }
-
- foreach ($queryDetails as $key => $value) {
- $this->newRelicWrapper->addCustomParameter($key, $value);
- }
-
- $transactionName = $queryDetails[LoggerInterface::OPERATION_NAMES] ?: '';
-
- $this->newRelicWrapper->setTransactionName('GraphQL-' . $transactionName);
- }
-}
diff --git a/etc/di.xml b/etc/di.xml
index 76bfb211..04e13efc 100644
--- a/etc/di.xml
+++ b/etc/di.xml
@@ -104,11 +104,4 @@
<argument name="queryComplexity" xsi:type="number">300</argument>
</arguments>
</type>
- <type name="Magento\GraphQl\Model\Query\Logger\LoggerPool">
- <arguments>
- <argument name="loggers" xsi:type="array">
- <item name="newRelic" xsi:type="object">Magento\GraphQl\Model\Query\Logger\NewRelic</item>
- </argument>
- </arguments>
- </type>
</config>