EkinoNewRelicBundle | Add NewRelic support to Symfony | Web Framework library
kandi X-RAY | EkinoNewRelicBundle Summary
kandi X-RAY | EkinoNewRelicBundle Summary
Add NewRelic support to Symfony
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Get the configuration tree builder .
- Loads configuration .
- On kernel response event .
- Perform the request .
- Process command event .
- Register monolog services .
- Send notice error .
- Set the ignore transaction .
- Registers deprecation .
- Prepare interactor .
EkinoNewRelicBundle Key Features
EkinoNewRelicBundle Examples and Code Snippets
Community Discussions
Trending Discussions on EkinoNewRelicBundle
QUESTION
To set some context, I'm working on a Symfony 4.4 API, which use a vendor named EkinoNewRelicBundle
to communicate data to the New Relic API.
This vendor uses a subscriber named RequestListener
to subscribe on the kernel.request
event of Symonfy to define data to send to the New Relic API.
I've got an issue in a specific case, when there is an authentication issue resulting in a 498, another subscriber from the SecurityBundle
throw an exception, stopping the request processing.
Unfortunately, a method of the EkinoNewRelicBundle
subscriber, named setTransactionName
, has a lower priority than the SecurityBundle subscriber, resulting in data not properly set by Ekino as the process is stop.
By editing by hand the vendor, I found that a priority 10
on the setTransactionName
would be enough to be executed before the SecurityBundle
.
I'm looking for a way to edit the priority of the RequestListener
priority at runtime.
So far, I've tried to :
- override the configuration, but as the priority is defined in a public static method from a class and seems to be loaded directly in the EventDispatcher, therefore it's no configuration to override ;
- use a compiler pass to manipulate the definition, but same as above, there is no definition to edit as it seems to be loaded directly in the EventDispatcher ;
- extend the Ekino subscriber to edit the priority, disabling the listner from the Ekino's configuration, but this results in configuration issue of my newly define subscriber as it can't be autowired.
Isn't there an easy way to change a priority of a subscribed event in a vendor's subscriber?
The maintener did talk about this seven years ago, when the configuration was still accessible with the compiler pass in this EkinoNewRelicBundle issue.
...ANSWER
Answered 2021-Oct-24 at 02:02As per the How to Override any Part of a Bundle Symfony Documentation.
If you want to modify the services created by a bundle, you can use service decoration.
As the Ekino\NewRelicBundle\Listener\RequestListener
is a service that is registered in the configs and autoconfigured by Symfony, you can create a decorator and add a custom getSubscribedEvents()
method to override the priorities.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install EkinoNewRelicBundle
PHP requires the Visual C runtime (CRT). The Microsoft Visual C++ Redistributable for Visual Studio 2019 is suitable for all these PHP versions, see visualstudio.microsoft.com. You MUST download the x86 CRT for PHP x86 builds and the x64 CRT for PHP x64 builds. The CRT installer supports the /quiet and /norestart command-line switches, so you can also script it.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page