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 Module cannot be removed #35479

Closed
1 of 5 tasks
IbrahimS2 opened this issue May 16, 2022 · 26 comments
Closed
1 of 5 tasks

NewRelic Module cannot be removed #35479

IbrahimS2 opened this issue May 16, 2022 · 26 comments
Assignees
Labels
Area: Framework Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Progress: done Reported on 2.4.4 Indicates original Magento version for the Issue report. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch

Comments

@IbrahimS2
Copy link

Preconditions (*)

  1. M2.4.4
  2. PHP8.1

Steps to reproduce (*)

  1. Remove NewRelic Entirely from composer
  2. Recompile the code

Expected result (*)

  1. All goes smooth, no issues

Actual result (*)

Area configuration aggregation... 5/9 [===============>------------]  55% 39 secs 370.0 MiB
In ClassReader.php line 57:
                                                                                                                                      
  Impossible to process constructor argument Parameter #0 [ <required> Magento\NewRelicReporting\Model\Config $config ] of Magento\   
  GraphQl\Model\Query\Logger\NewRelic class                                                                                           
                                                                                                                                      

In GetParameterClassTrait.php line 34:

  Class "Magento\NewRelicReporting\Model\Config" does not exist

Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.
@m2-assistant
Copy link

m2-assistant bot commented May 16, 2022

Hi @IbrahimS2. Thank you for your report.
To speed up processing of this issue, make sure that you provided the following information:

  • Summary of the issue
  • Information on your environment
  • Steps to reproduce
  • Expected and actual results

Make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:

@magento give me 2.4-develop instance - upcoming 2.4.x release

For more details, review the Magento Contributor Assistant documentation.

Add a comment to assign the issue: @magento I am working on this

To learn more about issue processing workflow, refer to the Code Contributions.


⚠️ According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.

🕙 You can find the schedule on the Magento Community Calendar page.

📞 The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.

✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

@1ci
Copy link

1ci commented May 16, 2022

Please fix this. I can't switch the deploy mode to production otherwise and the store is super slow.

Edit: I copied the module app/code/Magento/NewRelicReporting and it now works.. I guess the composer package is broken

@IbrahimS2
Copy link
Author

That is the thing; we do not want to have NewRelic entirely.

@engcom-Dash
Copy link
Contributor

@magento give me 2.4-develop instance

@magento-deployment-service
Copy link

Hi @engcom-Dash. Thank you for your request. I'm working on Magento instance for you.

@magento-deployment-service
Copy link

Hi @engcom-Dash, unfortunately there is no ability to deploy Magento instance at the moment. Please try again later.

@engcom-Dash
Copy link
Contributor

@magento give me 2.4-develop instance

@magento-deployment-service
Copy link

Hi @engcom-Dash. Thank you for your request. I'm working on Magento instance for you.

@magento-deployment-service
Copy link

Hi @engcom-Dash, unfortunately there is no ability to deploy Magento instance at the moment. Please try again later.

@m2-assistant
Copy link

m2-assistant bot commented Jun 7, 2022

Hi @engcom-Dash. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: 👇

    1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
      DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.
    1. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.
    1. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.
    1. Verify that the issue is reproducible on 2.4-develop branch
      Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
      - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
      - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

@engcom-Delta engcom-Delta added the Reported on 2.4.4 Indicates original Magento version for the Issue report. label Jun 7, 2022
@engcom-Dash
Copy link
Contributor

@magento give me 2.4-develop instance

@magento-deployment-service
Copy link

Hi @engcom-Dash. Thank you for your request. I'm working on Magento instance for you.

@magento-deployment-service
Copy link

Hi @engcom-Dash, unfortunately there is no ability to deploy Magento instance at the moment. Please try again later.

@engcom-Dash engcom-Dash added the Issue: needs update Additional information is require, waiting for response label Jun 8, 2022
@engcom-Dash
Copy link
Contributor

engcom-Dash commented Jun 8, 2022

Hi @IbrahimS2,

Can you please guide how you remove the NewRelic module using composer? Because we are unable to find the same in composer.json file of Magento 2.4.4

Thanks

@hostep
Copy link
Contributor

hostep commented Jun 8, 2022

@engcom-Dash: add the following lines to your composer.json file:

    "replace": {
        "magento/module-new-relic-reporting": "*"
    }

Then execute composer update magento/module-new-relic-reporting (which should remove that package) and then execute bin/magento setup:upgrade (so it gets removed from the app/etc/config.php file).
After that, re-try the steps from the opening post.

This is a common practice that Magento developers use to get rid of modules they don't need, see this blog post if you're interested.

I agree with the issue report, a dependency on the NewRelicReporting module should have never been made to the GraphQl module, that's bad design!
This was introduced in Magento 2.4.4 in scope of PWA-1311: New Relic is not being given useful transaction names for graphql requests
It would have been better if a new module got created to connect graphql with new-relic-reporting, that would have been a much cleaner solution.

@engcom-Dash engcom-Dash added Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Area: Framework labels Jun 17, 2022
@engcom-Dash
Copy link
Contributor

Hi @hostep ,
The issue Confirmed and we are also Getting Same results.
Here i Attached the Screenshot For your reference
Screenshot from 2022-06-17 12-56-28

Thanks.

@engcom-Hotel engcom-Hotel added Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Area: Framework labels Jul 15, 2022
@github-jira-sync-bot
Copy link

✅ Jira issue https://jira.corp.magento.com/browse/AC-5967 is successfully created for this GitHub issue.

@m2-assistant
Copy link

m2-assistant bot commented Jul 15, 2022

✅ Confirmed by @engcom-Hotel. Thank you for verifying the issue.
Issue Available: @engcom-Hotel, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

@engcom-Dash engcom-Dash removed the Priority: P2 A defect with this priority could have functionality issues which are not to expectations. label Jul 18, 2022
@engcom-Dash engcom-Dash added Progress: dev in progress Priority: P2 A defect with this priority could have functionality issues which are not to expectations. labels Jul 18, 2022
@m2-community-project m2-community-project bot removed the Issue: needs update Additional information is require, waiting for response label Jul 18, 2022
@sprankhub
Copy link
Member

I suggest that the Magento core team uses https://github.com/yireo/Yireo_ExtensionChecker/ to make sure all dependencies are found 🙈

@WebKenth
Copy link

We use GraphQL but not NewRelic, why the deep coupling between the two modules i have no clue, but here's my cent

main issue might be:
vendor/magento/module-graph-ql/etc/module.xml:12

Missing module sequence <module name="Magento_NewRelicReporting"/>

If you want to patch it while waiting for the core team to figure out how to resolve it:

You can use this patch:
It removes the di.xml reference to the logger module and empties the vendor/magento/module-graph-ql/Model/Query/Logger/NewRelic.php file

--- etc/di.xml
+++ 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>
--- Model/Query/Logger/NewRelic.php
+++ Model/Query/Logger/NewRelic.php
@@ -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);
-    }
-}

I've also added the replace on the new relic module to remove it completely from composer

"replace": {
...
        "magento/module-new-relic-reporting": "*"
...
}

@hostep
Copy link
Contributor

hostep commented Dec 27, 2023

Is probably fixed internally by a495fed, I guess this is going to get included in Magento 2.4.7

@hostep
Copy link
Contributor

hostep commented Apr 3, 2024

Confirmed with Magento 2.4.7-beta3, we can remove the magento/module-new-relic-reporting module again via composer and have a working setup:di:compile

FYI, you should probably also remove these 2 new modules that come with Magento 2.4.7 if you're not interested in New Relic:

  • magento/module-application-performance-monitor-new-relic
  • magento/module-graph-ql-new-relic

@tuyennn
Copy link
Member

tuyennn commented Apr 26, 2024

Still persist on Magento 2.4.7

@hostep
Copy link
Contributor

hostep commented Apr 26, 2024

@tuyennn : No it doesn't, it seems fixed in 2.4.7, see my previous comment...

This issue can be closed in my opinion.

@tuyennn
Copy link
Member

tuyennn commented Apr 26, 2024

@hostep agreed, that seems I applied the yireo replacement so find out this issue.

@IbrahimS2
Copy link
Author

IbrahimS2 commented Apr 26, 2024

It is fixed and working as expected, I will close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Framework Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Progress: done Reported on 2.4.4 Indicates original Magento version for the Issue report. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch
Projects
Development

No branches or pull requests

10 participants