magento2: NewRelic Module cannot be removed
Preconditions (*)
- M2.4.4
- PHP8.1
Steps to reproduce (*)
- Remove NewRelic Entirely from composer
- Recompile the code
Expected result (*)
- 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”.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 2
- Comments: 26 (7 by maintainers)
I suggest that the Magento core team uses https://github.com/yireo/Yireo_ExtensionChecker/ to make sure all dependencies are found 🙈
Confirmed with Magento 2.4.7-beta3, we can remove the
magento/module-new-relic-reporting
module again via composer and have a workingsetup: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
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
fileI’ve also added the replace on the new relic module to remove it completely from composer
@engcom-Dash: add the following lines to your
composer.json
file:Then execute
composer update magento/module-new-relic-reporting
(which should remove that package) and then executebin/magento setup:upgrade
(so it gets removed from theapp/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.
It is fixed and working as expected, I will close this issue.
@hostep agreed, that seems I applied the yireo replacement so find out this issue.
Is probably fixed internally by https://github.com/magento/magento2/commit/a495fed6e678da185a74de697c946e5637a781a1, I guess this is going to get included in Magento 2.4.7
Hi @hostep , The issue Confirmed and we are also Getting Same results. Here i Attached the Screenshot For your reference
Thanks.