Instana U

 View Only

How to monitor a Hybrid application with Instana

By JYOTI RANI posted Fri October 08, 2021 02:13 AM

  
This article covers Observability of Wealthcare Hyrbid application with Instana. To know more about this application please visit here. For the purpose of this writing we have deployed the Wealthcare application with below architecture however we will not deploy or use MQ as part of blog, Refer Blog for MQ monitoring with Instana.


1. Deploy Wealthcare application on Redhat Openshift

Wealthcare application consists of four microservices - Web UI, Users, Financial plan and Notification, which can be deployed on Redhat Openshift cluster. These microservices in turn connects with MySQL DB and MQ instances deployed on a VM for Hybrid behavior. Required yaml files for Wealthcare application deployment are available here. You can either apply them one by one or simply run 01-install.sh script to install the application in your OCP cluster.

2. Install and configure MySQL DB on VM

Install MySQL database on VM. You can follow https://www.digitalocean.com/community/tutorials/how-to-install-mysql-on-ubuntu-20-04 guide if you are deploying on ubuntu. After the installation is complete, create and initialize the database named 'wcare' for use by the wealthcare application.

DB Schema: https://github.com/ibm-gsi-ecosystem/wealthcare-cloud-native-app/blob/master/sql/schema-mysql.sql 
Sample Data: https://github.com/ibm-gsi-ecosystem/wealthcare-cloud-native-app/blob/master/sql/data.sql

3. Configure the Wealthcare application

Now that we have deployed the application on Openshift cluster and MySQL database on VM, we will integrate them together by configuring the application to point to MySQL instance.

a. Go to the Openshift project where wealthcare application is deployed and edit the config map 'wealthcare-config-map' to point to MySQL db server, as follows:

b. Also, update the Route for wealthcare-financialplan and wealthcare-user microservices in the configmap which are being called by the Web UI microservice (wealthcare-web) as below.

c. Save the configmap after applying above changes and then delete all pods for wealthcare application for changes to take effect.
d. Verify and access the application via route wealthcare-web e.g. http://wealthcare-web-wealthcare-ns.apps.ocpinstance.fyre.ibm.com/ to ensure application is up and running. You can login to the application with sample users configured in the MySQL database in wcusers table.

4. Instana

I have used Instana SaaS instance for Observability in this article but it can be any kind of Instana deployment with access to Openshift cluster and VM where application components are running. You can also use Instana 14 day trial https://www.instana.com/trial/

5. Deploy and Configure Instana Agents

Lets now deploy the Instana Agents for Openshift cluster as well as VM where MySQL db is running.

a. Deploy Openshift agent

1. From the Instana console, Go to More -> Agents -> Installing Instana Agents and select Openshift. Go here for more details.
2. Specify the cluster name and agent zone and copy/download the generated yaml file. Note that although agent zone is optional but its useful for logical grouping of application components hence we will use the same agent zone name for Openshift cluster agent as well as VM agent.

3. Now apply the downloaded agent yaml file to the OCP cluster where wealthcare application is running.
4. After the agent is deployed, it will create a project 'instana-agent' in the OCP cluster, make sure all pods in that namespace are running. This completes the deployment of the instana agent for Openshift cluster.
5. We can also verify from Instana console if agent is reporting successfully or not. Go to More -> Agents and search by cluster name or agent zone name, we specified in step#2 above. This should show as below:

b. Deploy Host Agent

Now we will deploy Host agent for monitoring MySQL database running on VM for our hybrid application. Go here for more details
1. From the Instana console, Go to More -> Agents -> Installing Instana Agents and select the respective Operating system as per your VM host and keep the default configuration as below:

2. Copy and execute the command on the target VM where database is running.
3. By default, the agent is not up and running after installation, you can verify by running 'systemctl status instana-agent' which shows status as 'inactive'.
4. Before we start the agent, lets configure the agent and set the Zone as the same as our OpenShift cluster agent. Edit the agent config /etc/systemd/system/instana-agent.service.d/custom-environment.conf and specify the zone name as below:
5. Now start the agent 'systemctl start instana-agent' and then verify the status using 'systemctl status instana-agent' and it should show as 'active (running)'
6. This completes the host agent setup. Now agent will be able to discover all the processes running on the VM with the help of sensors. There is a huge list of technology sensors supported by the agents which you can find by going to Instana console -> More -> Agents -> Locate and click on your host agent and click on sensor Info.

6. Verify Instana agents started reporting
From the Instana console, Go to More -> Agents and search by agent zone name (myzone) and it should show as below:
Also, Go to Infrastructure view and search by zone name you had specified and notice that the tech stack is already been discovered by the agent/sensors.

7. Create Application perspective
Now that our application is up and running, and instana agents deployed and started reporting, lets start capturing and analyzing various metrics for our hybrid application.
a. Go to Applications -> Click Add -> New Application perspective
b. Select Kubernetes/Container and click Next
c. Specify the filter based on zone and namespace as below and leave the rest default and click Next.
d. Specify the name of the Application perspective and click create.

8. Analysis and Observation of Hybrid application
a. Access the wealthcare application or put some load to see the metrics in the newly create application perspective.

b. Go to Dependencies tab and you will notice that it already shows the MySQL db service in the dependency graph which is being accessed by the Financial plan and Users services. It also show how the traffic flows between these services visually.

c. Review the stack and under Infrastructure you will see the Hybrid infra where the application components are running, as below:
d. Click on 'Analyze Calls' and select service 'container-financialplan' and see the list of calls from this service along with timestamp and latency.
e. Click on any of the listed call to analyze it further like trace, timeline, service endpoint list, calls and logs etc. From this view, we can clearly see the how these services are interacted across our hybrid application.


Conclusion

In this article we have seen how Instana agents/sensors can help in Hybrid application monitoring with detailed context of how different parts of the application interact with each other along with traces, latency, logs, stacktrace etc. which can further help analyze the issues across application components and their impact.


#Instana
#HowTo
#monitoring
#APM
#observability
#hybrid
#setup
#Openshift
#MySQL
1 comment
103 views

Permalink

Comments

Mon October 11, 2021 10:27 AM

Well documented! Thanks for sharing Jyoti 👍