Is it possible to instrument an RPC library?
Can I instrument my RPC library to show performance data, like SQL is wrapped? It's neat to see the ms taken by each SQL query, but I also have some RPC calls I make. Can I write some code to show those as well?
1
person has this question
I have this question, too!
Tell me when someone answers.
The more people who ask this question, the more it gets noticed.
The more people who ask this question, the more it gets noticed.
The best answer from the company
-
You can add custom instrumentation by designating your RPC method calls as traced. Then they will show up in transaction traces. Here is the doc:
Adding visibility to a Transaction Trace
If your transaction traces have long periods of time where the New Relic Agent probes have zero visibility, you can add visibility by adding method instrumentation. To instrument a method such as #log in your application so that it shows up in Transaction Traces, add the following code to the class to instrument:
add_method_tracer :log, 'Custom/<class>/<method>', :metric => false
The :metric => false option tells the Agent to have this probe only participate in transaction traces and not produce streams of metric data.
CAUTION - adding probes to your code adds overhead. Each probe burns about 20 microseconds of CPU. Be careful not to probe a method that's called frequently in a loop.
</method></class>
The company and 1 other person say
this answers the question
Create a customer community for your own organization
Plans starting at $19/month
-
Inappropriate?You can add custom instrumentation by designating your RPC method calls as traced. Then they will show up in transaction traces. Here is the doc:
Adding visibility to a Transaction Trace
If your transaction traces have long periods of time where the New Relic Agent probes have zero visibility, you can add visibility by adding method instrumentation. To instrument a method such as #log in your application so that it shows up in Transaction Traces, add the following code to the class to instrument:
add_method_tracer :log, 'Custom/<class>/<method>', :metric => false
The :metric => false option tells the Agent to have this probe only participate in transaction traces and not produce streams of metric data.
CAUTION - adding probes to your code adds overhead. Each probe burns about 20 microseconds of CPU. Be careful not to probe a method that's called frequently in a loop.
</method></class>
The company and 1 other person say
this answers the question
-
Inappropriate?Great! That works.
The SQL lines in the developer interface, like "Database/SQLite/User Load ?" have an additional column that says "SQL" which you can click to get to see the SQL query. Similarly it would be nice if my RPC calls showed the URL that was hit. How can I do that? -
Inappropriate?Hi ghazel,
There is no way to annotate traced methods with data in a generic way. However, it's a good idea and we'll definitely consider it for a future release.
- Jim
1 person says
this answers the question
-
Inappropriate?Welcome!
Loading Profile...



EMPLOYEE
EMPLOYEE