|||

Video Transcript

X

Best Practices for Optimizing Your Enterprise Cloud Applications with New Relic

If your cloud application performs poorly or is unreliable, users will walk away, and your enterprise will suffer. To know what’s going on inside of your million-concurrent-user application (Don’t worry, you’ll get there!), you need observability. Observability gives you the insights you need to understand how your application behaves. As your application and architecture scale up, effective observability becomes increasingly indispensable.

Heroku gives you more than just a flexible and developer-friendly platform to run your cloud applications. You also get access to a suite of built-in observability features. Heroku's core application metrics, alerts, and language-specific runtime metrics offer a comprehensive view of your application’s performance across the entirety of your stack. With these features, you can monitor and respond to issues with speed.

In this article, we’ll look at these key observability features from Heroku. For specific use cases with more complexity, your enterprise might lean on supplemental features and more granular data from the New Relic add-on. We’ll explore those possibilities as well.

At the end of the day, robust observability is a must-have for your enterprise cloud applications. Let’s dive into how Heroku gives you what you need.

Application Metrics

Heroku provides several application-level metrics to help you investigate issues and perform effective root cause analysis. For web dynos (isolated, virtualized containers), Heroku gives you easy access to response time and throughput metrics.

  • Response time metrics include the median, 95th percentile, and 99th percentile times, offering a clear picture of how quickly the application responds under typical and extreme conditions.
  • Throughput metrics are broken down by HTTP status codes, helping you identify traffic patterns and pinpoint areas where requests may be failing.

Across all dynos types (except eco), Heroku gathers memory usage and dyno load metrics.

  • Memory usage metrics include data on total memory, RSS (resident set size), and swap usage. These are vital for understanding how efficiently your application uses memory and whether it’s at risk of exceeding memory quotas and triggering errors.
  • Dyno load measures the load on the container’s CPU, providing a view into how many processes are competing for time — a signal of whether your application is overburdened or not.

These metrics are crucial for root cause analysis. As you examine trends and spikes in these metrics, you can identify bottlenecks and inefficiencies, preemptively addressing potential failures before they escalate. Whether you’re seeing a surge of slow response times or an anomalous increase in memory usage, these metrics guide developers in tracing the problem back to its source. Equipped with these metrics, your enterprise can ensure faster and more effective issue resolution.

1-application-metrics

Threshold Alerting

Threshold alerting allows you to set specific thresholds for critical application metrics. When your application exceeds these thresholds, alerts are automatically triggered, and you’re notified of potential issues before they escalate into major problems. With alerts, you can take a proactive approach to maintaining application performance and reliability.

This is particularly useful for keeping an eye on response time, memory usage, and CPU load. By setting appropriate thresholds, you ensure that your application operates within its optimal parameters to prevent resource exhaustion and maintain performance.

Threshold alerting is available exclusively for Heroku’s professional-tier dynos (Standard-1X, Standard-2X, and all Performance dynos).

threshold alerting

Language Runtime Metrics

Heroku provides detailed insights into memory usage by offering language-specific runtime metrics for applications running on JVM, Go, Node.js, or Ruby. Metrics include:

  • JVM applications: Heap memory usage and garbage collection times.
  • Go applications: Memory stack, coroutines, and garbage collection statistics.
  • Node.js and Ruby applications: Heap and non-heap memory usage breakdowns.

These insights are crucial for developers in identifying memory leaks, optimizing performance, and ensuring efficient resource utilization. Understanding how memory is consumed allows developers to fine-tune their applications and avoid memory-related crashes. By tapping into these metrics, you can maintain smoother, more reliable performance.

These metrics are available on all dynos (except eco), using the supported languages.

3-language-runtime-metrics

To utilize these features, first enable them in your Heroku account. Then, import the appropriate library within your applications’ build and redeploy.

Heroku and New Relic for the Win

In most cases, the above observability features give you enough information to troubleshoot and optimize your cloud applications. However, in more complex situations, you may want an additional boost through a dedicated application performance monitoring (APM) solution such as New Relic. Heroku offers the New Relic APM add-on, which lets you track detailed performance metrics, monitor application health, and diagnose issues with real-time data and insights.

Key features from New Relic include:

  • Code-level diagnostics: Allows developers to identify problematic areas in their code that may be causing performance bottlenecks. This helps in optimizing the application and ensuring lower latency user experiences.
  • Transaction tracing: Provides visibility into the life cycle of each transaction within the application. Trace requests from start to finish, pinpointing delays or errors that may occur during specific processes.
  • Customizable instrumentation: Enables developers to tailor the monitoring and data collection to their specific needs, providing more granular insights and control over application performance

Features such as these enable more effective troubleshooting and optimization, helping you ensure that your applications run efficiently even under heavy load.

The New Relic APM add-on integrates seamlessly with your application, automatically capturing detailed performance data. With the add-on installed, you can:

  • Regularly review transaction traces to identify slow-performing transactions.
  • Use error analytics to monitor and address issues in real time.
  • Leverage detailed diagnostics to continuously improve the application's performance.

Connecting your application to New Relic agents is straightforward. You simply install a New Relic library in your codebase and redeploy. The APM solution’s advanced features also allow for more fine-grained control of the data you’re sending. In addition to monitoring application state and metrics, you can also use it to monitor logs and infrastructure.

4-new-relic-heroku-2 4-new-relic-heroku-1

Conclusion

In this blog, we’ve explored the advanced observability features from Heroku along with the additional power offered by the New Relic APM add-on. Heroku’s observability features alone provide the metrics and alerting capabilities that can go a long way toward safeguarding your deployments and customers’ experience. New Relic further enhances observability with its APM capabilities, such as code-level diagnostics and transaction tracing.

Staying proactive with cloud application observability is key to maintaining enterprise application efficiency. Robust observability helps you ensure that your applications are running smoothly, and it also enables you to handle unexpected challenges. With a strong observability solution, you gain insights that help you sustain application performance and deliver a superior user experience.

To learn more about enterprise observability, read more about the features Heroku Enterprise has to offer, or contact us to help you get started.

Originally published: October 08, 2024

Browse the archives for ecosystem or all blogs Subscribe to the RSS feed for ecosystem or all blogs.