Key transactions are a way for engineering teams to create custom level monitoring on their most meaningful transactions. The APM monitoring tools of New Relic help you swiftly detect and solve problems before they impact your users by reporting on all transactions. But sometimes the information that is essential to running your digital business isn't the most highly trafficked. This is where key transactions can help you track essential transactions you want to monitor and manage—regardless of the overall application throughput.
Key transactions in practice
Let's think about a scenario where a customer logs in to your e-commerce application to purchase a phone. The customer experiences slow response when they try load the plans page and browse the services. This results in the customer leaving the site and abandoning the purchase. Your PlanService microservice team needs to quickly identify the root cause of this slowdown and fix it to avoid losing more customers.
Your team starts by identifying PlanService's most important business transaction: getPlans (which loads the plans page). Then, you need to make getPlans a key transaction, apply relevant tags, and analyze it within the context of the greater entity ecosystem.
You can learn more about transactions and if your framework supports them in our APM docs.
Select Make key transaction in the transaction details view. You can also automate this step by using the REST API to both create and stop tracking key transactions.
After you create key transactions, they become part of the New Relic entity ecosystem. You can see all the transactions, including the getPlans key transaction you just created, under the entity list view.
Let's say you want to rename your key transaction to make it more accurate or easier to filter, here's how:
Key transaction Apdex settings override the T value set for that app. This can mean, for example, that a key transaction could be reported as Satisfied but a different transaction in the same app with the same response time could be Frustrated.
From the index, select the Key Transaction you want to delete.
Choose Application in the settings area from the left navigation.
Select stop tracking key transaction.
New Relic automatically deletes any associated alerts and events for the deleted key transaction.
Tag key transactions
In APM, you can organize and filter the key transactions so you can quickly determine the teams, environments, or the priority levels, by adding a tag to your key transactions. These tags also provide context so you can isolate the issue when you get an alert notification.
Tags are metadata associated with transactions. They're useful for applying to transactions that have things in common. For example, you might apply a checkout tag to all key transactions that are part of the checkout process. Then you can filter by checkout to see all of those transactions in one place.
In our scenario, the PlanService microservice team is trying to identify slowdowns at checkout and they might want to easily filter by environment or accountid so they can identify problems and find fast solutions.
Click the Filter by ... field to see a dropdown of available attributes and tags or enter a tag you want to filter by, such as accountId: 123456789.
Group key transactions and create alerts
After you've created a key transaction you can increase its visibility by connecting it to our tools and workloads.
In New Relic, you can use workloads to group together entities that make up a specific business service. This grouping makes it easier to isolate and troubleshoot issues. Add your key transactions to workloads along with the related services and hosts, so you can get an aggregated view of the health and activity of the entities that make up your stack.
This example screenshot shows a comprehensive workload view of the getPlans key transaction with all the other related entities.
Now that your key transaction is part of a workload and tagged, the next step is to create alerts so you're notified when there is any unusual behavior in your transaction. You can set up both static alerts and anomaly alerts on key transactions using the powerful and flexible NRQL alerting system and now you can also add your key transactions to dashboards. If you want to set up alerts or add the key transactions to dashboards, you can do so directly from the key transaction charts by clicking the ellipsis.
In addition to alert thresholds, you can also measure the performance from your application users' point of view. To do this, set up service levels against the business key transactions.
Use key transactions in context
After you've created a key transaction, added tags, created workloads, and set up alerts, you can start to analyze your data in context with other entities that you monitor. Once you understand its role within your wider system you can take any additional steps to improve uptime and reliability.
To quickly analyze deviations in all your key transactions, you can start with New Relic Lookout. This provides a real-time view of your transactions across all your accounts, highlighting changes in all of your telemetry. In this example, you can see the getPlans transaction shows an increase in response time:
To understand the complete impact of the getPlans transaction performance degradation, you can use a service map. You can visualize the health of all the other connected entities like the originating service, hosts, databases, and other key transactions.
To track the impact of any change event, such as code deployments, configuration changes, and business events, you can use the change tracking markers on the key transaction charts. This helps you drill down further in the trace to troubleshoot the changes that are causing issues.
In this screenshot, you can see a spike in the getPlans transaction time right after a deployment for optimizing a database query. This helps you trace back the problem to the deployment. In this example, when we reverted the change, the transaction time went back to normal and the plans page started loading quickly.