Skip to content

Magento 2 Support : Controller Decomposition #690

Open
@sankalpshekhar

Description

@sankalpshekhar

Description

In recent years Magento has introduced controller decomposition to provide a performance boost, wherein the controllers are suggested to no more inherit the Magento\Framework\App\Action\Action class for frontend controllers.

The Action class has been marked deprecated. However, the classes in the core haven't been updated to new recommendations.

But as a developer, if we use the recommended approach (to gain performance), NR doesn't identify them as distinct transactions and rolls all of them to as WebTransaction/Action/FrontController/Magento\Framework\App\FrontController\Interceptor. Hence making the NewRelic transaction monitoring ineffective.

Steps to Reproduce

  1. Create a custom module in Magento
  2. Add 2 Controller classes with different implementations, one that extends the deprecated class and the other with an interface approach (as recommended in the decomposition article)
  3. Hit the URLs multiple times to trigger NewRelic monitoring
  4. Head to NRQL and execute a query similar to the one below and check for the transaction names

SELECT timestamp, appName, name, request.uri from Transaction WHERE appName ='some_app_name' and request.uri like '%common_controller_name%'

Expected Behavior

Each controller action is listed distinctly in the transactions.

Relevant Logs / Console output

Your Environment

  • ex: Browser name and version:
  • ex: Operating System and version:

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions