-
Notifications
You must be signed in to change notification settings - Fork 9.4k
[Forwardport] Add Ability To Separate Frontend / Adminhtml in New Relic #15947
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
[Forwardport] Add Ability To Separate Frontend / Adminhtml in New Relic #15947
Conversation
This would happen if for some reason the area code wasn't set
lol @ihor-sviziev was just about to do this and noticed you already took care of it. thanks! https://github.com/magento/magento2/compare/2.3-develop...mpchadwick:feature/2.3/new-relic-separate-areas?expand=1 |
Declare strict types
Declare strict types
@magento/open-source-maintainers please review my PR |
@ihor-sviziev Your code is not up to the Magento coding standards. Please resolve these issues before we can review your pull request. See codacy for more information. |
@cream-julian In tests we can use ObjectManager, it's allowed. Original PR with the same changes was already merged |
* | ||
* @param State $subject | ||
* @param null $result | ||
* @return void |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
your code returns some data, please update doc-block or fix code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also wouldn't be wrong to auto-format this so that the variable names are aligned under each other. I'm not sure if this is required in the magento coding standards though...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@igortregub we can use "mixed", but actually it doesn't matter. Will update PR
@abbasalis it's not required in magento coding standards
|
||
/** | ||
* @param Config $config | ||
* @param NewRelicWrapper $newRelicWrapper |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add $logger
param
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. will Update PR
return false; | ||
} | ||
|
||
return true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd simply say
return (
$this->config->isSeparateApps()
&& $this->config->getNewRelicAppName()
&& $this->config->isNewRelicEnabled()
)
What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will update it
*/ | ||
private $objectManager; | ||
|
||
protected function setUp() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add your docblocks here please
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
declare(strict_types=1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you use strict type, would be great to use return types as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
* @magentoConfigFixture default/newrelicreporting/general/app_name beverly_hills | ||
* @magentoConfigFixture default/newrelicreporting/general/separate_apps 1 | ||
*/ | ||
public function testAppNameIsSetWhenConfiguredCorrectly() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you don't check case if adjusting is disabled and exception
…to2 into 2.3-develop-PR-port-12935
- Minor improvements
Hi @ishakhsuvarov, |
- Minor improvements
@ihor-sviziev Happy to help. I think it would make sense to hold on with a 2.2 PR while this gets delivered |
@ishakhsuvarov sure! |
Hi @ihor-sviziev. Thank you for your contribution. |
Accepted Public Pull Requests: - #18126: [Backport] [2.2] Changed intval($val) to (int) $val, since it is faster: (by @dmytro-ch) - #18000: Fix sitemap grid render incorrect base urls for multiple stores (by @nntoan) - #18098: Fix shipping discount failed to apply during place order (by @torreytsui) - #18113: [Backport] Fixes from #15947 (by @ihor-sviziev) - #18097: [Backport] Fix import grouped products #12853 (by @insanityinside) - #17993: fix #17582 ./bin/magento config:show fails with a fatal error (by @keyurshah070) - #17679: Update shipment collection to unserialize `packages` attribute after load (by @dnsv) - #18055: fix: reset search mini-form when we have no data / an empty response (by @DanielRuf) - #14065: Correctly convert config integration api resources (by @therool) Fixed GitHub Issues: - #17999: Sitemap grid display incorrect base URL in the grid if using multiple stores (reported by @nntoan) has been fixed in #18000 by @nntoan in 2.2-develop branch Related commits: 1. 1172aae - #17582: ./bin/magento config:show fails with a fatal error (reported by @simonworkhouse) has been fixed in #17993 by @keyurshah070 in 2.2-develop branch Related commits: 1. ae503f6 - #12095: Update 2.2.1: One or more integrations have been reset because of a change to their xml configs. (reported by @thomvanderboon) has been fixed in #14065 by @therool in 2.2-develop branch Related commits: 1. 89a0a09 2. 5815a20 3. 406935b 4. 3868e81 5. 42eab52
Original Pull Request
#12935
Description
Adds a new setting which, when enabled, reports frontend and adminhtml as separate apps to New Relic.
frontend and adminhtml are in addition to the "main" app which includes both (for backwards compatibility). The user needs to set "New Relic Application Name" to use this feature as the area is appended to the appname setting, separated by and underscore.
Useful as slow transactions in admin activity can cause false positives New Relic alerts / skew average response time metrics. Using this feature allows monitoring and alerting on only frontend traffic by configuring alerts for just the frontend New Relic app.
Manual testing scenarios
Contribution checklist