Your data. Anywhere you go.

New Relic for iOS or Android

Download on the App Store    Android App on Google play

New Relic Insights App for iOS

Download on the App Store

Learn more

Close icon

Graph of good responses vs bad


My boss would like to have a graph on our dashboard that shows the number of good responses (200) and the number of bad responses (500) on the same graph. The error rate graph the ratio of these two, but he’d like to see them both side by side. I can’t find a way in the custom dashboard setup to put two metrics on the same graph.


By default, you won’t be able to combine these into one graph within RPM - we don’t in fact even gather the number of “good” responses - just the number of bad responses and the number of total responses (which is actually what error rate is: #errors/total transactions). And further as you’ve discovered, those stats that we gather are not co-graphable - they need to be in a similar namespace (you could graph different types of errors - web vs non-web, on the same graph, because you can construct a simple wildcard match to match just those metrics: Errors/*).

However, the good news is that with a very small amount of custom code using the agent API (check our docs site, for your agent - each agent has an ‘agent API’ doc with an equivalent call) you could gather these stats and then co-graph them in a custom dashboard. I’d do something like this (pseudocode):

process_request() {
// all of your existing code
    if (error has occurred) {
        record_custom_metric("Custom/Error/error", 1);
    } else {
        record_custom_metric("Custom/Error/success", 1);

Obviously your code may be a little more complicated - you may have to put the record_custom_metric call in an error handler instead of your main code flow, and then only record the metric in your main code flow if you don’t exit through an error handler, but the idea is the same.

Then in a custom dashboard, you can graph Custom/Errors/* , call_count field, and you’ll have what you’re looking for.