Question

I have installed New Relic on my live instance on AWS . New Relic identifies correctly the drupal modules and also the mysql database. On my environment there is a drupal module that connects with an external DB hosted on another machine. I would like to see the data on new relic for this connection and to be able to drill down to the messages exchanged within this specific module. New Relic only identifies this module and I can see the data from this module as a whole but I can't see the data related to the database connection. I am not sure if this is possible but I appreciate any king of thoughts, ideas or solutions. NewRelic is doing wonders for me but this would be a major breakthrough for the project I am running as this module is a legacy piece which as several files encrypted and I would like to have as much data as possible from it to be able to analyze the performance of DB and also be able to have a scaling strategy for the future. Note that the external DB is a RAIMA DB .

Was it helpful?

Solution

New Relic's PHP agent has no built-in support for Raima DB so getting good data abouts calls to and responses from Raima DB won't be as simple as MySQL which works out of the box.

However, if you have access to the code where Raima DB is being called and are willing to do a little work, you can collect some data that might be helpful by using the custom parameters, custom metrics and custom dashboards features of New Relic.

Custom Parameters By using custom parameters, you can record the queries made to Raima DB associated with slow transactions. To collect a custom parameter, use the New Relic API call "newrelic_add_custom_parameter (key, value)" Where the key is something like "RaimaQuery1" and the value is the query.

https://newrelic.com/docs/instrumentation/collecting-custom-parameters

Custom Metrics By using custom metrics and a little of your own timing code, you can collect time spent in various kinds of queries to Raima DB. You might want to collect metrics like "Custom/Raima/Select", "Custom/Raima/Update" etc or you might decide it's helpful to add the table name to the metric. I would suggest using "microtime" to get the current time before making a Raima DB query and then again when the call returns. Record the difference in your custom metrics. Custom metrics have two advantages over custom parameters: you can collect time metrics and graph them, and the metrics you collect cover all accesses to Raima DB rather than just slow transactions. Custom metrics won't show you the actual query being made like custom parameters will, so using both is probably the best way to get the data you want.

https://newrelic.com/docs/instrumentation/custom-metric-collection

Custom Dashboards Once you've collected some custom metrics, you will need custom dashboards to display them. The metrics you have chosen to collect will have a big impact on how you are able to display them on a custom dashboard. For example, charting "Custom/Raima/" in the previous example would show you the relative performance of operations across all calls, but if you were to add table names, charting "Custom/Raima/Select/" would show you the relative performance of select operations across tables. You might also decide to collect metrics per transaction name. If you do that it's important to keep the number of metrics limited because collecting too many metrics can make charts cluttered and unreadable as well as making the whole custom dashboard slow to use. You should plan to chart a handful of metrics together and collect no more than 2000 custom metrics names in total across the entire application.

https://newrelic.com/docs/instrumentation/creating-custom-dashboards

If you don't have access to the code, you can submit a feature request for Raima DB support at https://support.newrelic.com. And there are always new features just around the corner so keep an eye out for new possibilities; the best answer could change.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top