Instana U

 View Only

Tracing Node.js applications in SAP Business Technology Platform by using Instana

By Joice Joy posted 13 days ago

  

Authors: @Joice Joy, @Ankit Guria

This blog explains you about SAP Business Technology Platform (BTP) and tracing the Node.js applications that are deployed in an SAP BTP environment by using Instana Observability tool.

What Is SAP BTP?

SAP BTP is an innovation platform optimised for SAP applications in the cloud. It combines application development and automation, data and analytics, integration, and AI capabilities in a unified environment. SAP BTP allows you to create personalised experiences across business processes, build applications, analytics, and integrations faster, and run mission-critical innovation confidently on major cloud providers' infrastructure, fully managed by SAP.

BTP is SAP’s integration and application development platform for SAP clients who want to extend their S/4 system. It is based on Cloud Foundry and Kubernetes technologies.

Why SAP BTP and IBM Instana?

IBM® Instana is a powerful observability tool that helps you analyze and troubleshoot microservices and cloud native applications. It provides automated application performance monitoring, end-user experience monitoring, root cause analysis, and anomaly detection. By using Instana, you can gain complete visibility into the health and performance of your applications and services.

Installing the Instana standalone serverless agent in SAP BTP would enables monitoring of various applications such as Node.js, Python, and Java Spring Boot.

Tracing Node.js applications in SAP BTP by using Instana

To enable tracing for Node.js applications in SAP BTP, you need to add the Instana-provided Node.js serverless collector package to the application and activate the collector to start tracing.

  1. Installing the Node.js serverless collector as a local dependency:

To install the serverless collector as a local dependency, complete the following steps:

Add the package @instana/serverless-collector to your project's dependencies:

If you use npm, run the following command:

npm install --save @instana/serverless-collector`

If you use yarn, run the following command:

yarn add @instana/serverless-collector

  1. Activate the Node.js serverless collector:

The Node.js applications can be deployed to the SAP BTP Cloud Foundry environment by using the manifest.yml file. The manifest file contains the application name, host, domain, build pack details, and environment variables. Include the Instana-specific properties and ensure the previously installed Node.js serverless collector is activated in the environment variables by using the following sample manifest file:

applications:
- name: node-demo-api
  host: node-demo-api
  domain: cfapps.ap21.hana.ondemand.com
  buildpacks:
    - nodejs_buildpack # the final buildpack which is optional
  env:
    NODE_OPTIONS: '--require ./node_modules/@instana/serverless-collector'
    INSTANA_AGENT_KEY: '' # the agent key for the authentication
    INSTANA_ENDPOINT_URL: '' # the endpoint where the captured trace info will be send
    INSTANA_LOG_LEVEL: '' # the log level

Tracing is activated once you successfully deployed the application to the SAP BTP environment by using the ‘cf push’ command. You can then view trace information and the flow between different services through the Instana dashboard.

  • Sample Node.js application (node-demo-api) deployed by using the manifest.yml file:

  • Node.js demo application:

In the Instana dashboard, you can create an Application Perspective view to see the application summary, dependency graph, services, detailed error and log messages, infrastructure correlation, and create smart alerts.

  • Summary:

The Summary page provides information on total calls per second, erroneous calls (4xx, 5xx), average call latency, and a chart representing total calls based on HTTP status codes. You can analyze calls by clicking on the HTTP status codes in the chart.

  • Dependencies:

The dependency graph helps to identify the services that are involved in each call and the flow between services. You can view the interactions such as microservice-to-microservice, microservice-to-database, or calls to any other external services.

  • Analyze calls:

Analyzing the calls of a trace helps to understand the unexpected errors or service unavailability in an application. You can view the total calls, endpoints, HTTP status codes, HTTP methods, latency, and error message, along with the stack trace whenever a service failure occurs.

  • Error and Log messages:

The following section provides the total erroneous call count and detailed error log messages from the application.

a) Error messages:

b) Log messages:

  • Smart Alerts:

Smart Alerts are created when an event is triggered. Smart Alerts for application perspectives provide out-of-the-box blueprints such as slow calls, erroneous calls, HTTP status codes, and throughput. Additionally, you can choose from various threshold types, including ones that apply statistical models. You can configure the Smart Alerts by creating different alerting channels such as emails, Slack, Microsoft Teams, PagerDuty, and WebHooks, and more.

a) Email notification when an event is triggered:

b) View the event in the Instana dashboard:

Conclusion

IBM Instana provides real-time analytics, a crucial technology that enhances the functioning of SAP BTP’s cloud-native applications. By using advanced analytics and AI, Instana enables real-time monitoring, proactive issue diagnosis, and speedy performance optimization.

Permalink