Can we put alerts on specific transaction

hi i want to know can we make alerts on individual Transaction type what are best practices for this

Hi @deepank - It is possible to set up Key Transaction alerts on Key Transactions

I would suggest that you review the training materials as this will help you determine whether you need a general APM alert from your API or a more specific alert based on individual transaction response times.

2 Likes

Hi, @deepank: Do you mean “10 APIs in your application”? Having 10 APIs in your transaction does not make sense. You may use an NRQL alert condition to monitor the response time of an individual transaction:

SELECT average(duration) FROM Transaction WHERE appName = 'Your Application' AND name = 'Your Transaction'

I agree with @stefan_garnham that you should take advantage of the free training we offer on New Relic Alerts and writing NRQL queries.

1 Like

We have told you two ways to do it. Repeating the question will not change the answer. :slight_smile:

1 Like

is average(duration) used to get the response time

Hi @deepank

is average(duration) used to get the response time

Yes, that is exactly right. The query you posted would work great at tracking response time on a per-transaction level.

Another way to create queries that extract metrics from specific, named transactions is to use a metric timeslice query. Follow this link to read a thread on pro-tips for these queries. Notice that the first tip is for a query that returns error rate, faceted by transaction name.

I would recommend focusing your efforts on creating NRQL alert conditions for these use-cases, since Key Transaction conditions (along with most other condition types) will be going away in favor of NRQL conditions, as mentioned in this announcement. Simply starting with NRQL alert conditions will save you the effort of migration in late 2022.

1 Like

is there any best way to find which api is taking much response time in a service. without hardcoding for all api’s
SELECT average(duration) FROM Transaction WHERE appName = 'Your Application' AND name = 'Your Transaction'

SELECT average(duration) FROM Transaction WHERE appName = 'Your Application' FACET name

I recommend that you install the NRQL Lessons app in your account and go through the lessons to learn how to write NRQL queries.