Home Explore Blog CI



kubernetes

6th chunk of `content/en/blog/_posts/2017-05-00-Managing-Microservices-With-Istio-Service-Mesh.md`
612f366d243e0a2623fc84c39959ae63239b70066d21acb300000001000007f1
![BookInfo-v1-Istio (5).png](https://lh3.googleusercontent.com/4gc7Yp7vX3uQjcJ7UUBTSP8szTyIn_muB9Xn8UvS8UMJ2C-OQApiX1NObwuqS92hJ42KjkUKt3otGjPtOUQhkb_qlauJA3ezOOu8KH4VchOE8DcY4JvO0aXjaTnVX_ivgbWyGqka)

This time we will access the app using the NodePort address of the Istio Ingress controller:



 ```
export BOOKINFO\_URL=$(kubectl get po -l istio=ingress -o jsonpath={.items[0].status.hostIP}):$(kubectl get svc istio-ingress -o jsonpath={.spec.ports[0].nodePort})
  ```



We can now load the page at http://$BOOKINFO\_URL/productpage and once again see the running app -- there should be no difference from the previous deployment without Istio for the user.  

However, now that the application is running in the Istio service mesh, we can immediately start to see some benefits.



**Metrics collection**  


The first thing we get from Istio out-of-the-box is the collection of metrics in Prometheus. These metrics are generated by the Istio filter in Envoy, collected according to default rules (which can be customized), and then sent to Prometheus. The metrics can be visualized in the Istio dashboard in Grafana. Note that while Prometheus is the out-of-the-box default metrics backend, Istio allows you to plug in to others, as we’ll demonstrate in future blog posts.  


To demonstrate, we'll start by running the following command to generate some load on the application:



 ```
wrk -t1 -c1 -d20s http://$BOOKINFO\_URL/productpage
  ```



We obtain Grafana’s NodePort URL:



 ```
export GRAFANA\_URL=$(kubectl get po -l app=grafana -o jsonpath={.items[0].status.hostIP}):$(kubectl get svc grafana -o jsonpath={.spec.ports[0].nodePort})
  ```



We can now open a browser at http://$GRAFANA\_URL/dashboard/db/istio-dashboard and examine the various performance metrics for each of the Bookinfo services:



 ![istio-dashboard-k8s-blog.png](https://lh5.googleusercontent.com/yFBKYWEmNxs-8VLtlJIG4BV0dUzqrvCfhWLh2CrGHyTtH5dArQy-owua3vdMCSjkdjtk8E3ZmEz32EupRL28WHALLm9MqJwCJrs1N5yv8typUJiLS_ExsO-uleaZ3bgbPraC8lgi)

Title: Accessing Bookinfo Application and Viewing Metrics in Grafana
Summary
The Bookinfo application is accessed using the NodePort address of the Istio Ingress controller. Despite running in the Istio service mesh, the user experience remains the same as the deployment without Istio. One key benefit of Istio is the automatic collection of metrics in Prometheus, generated by the Envoy proxy. These metrics can be visualized in the Istio dashboard in Grafana. To generate load on the application, the 'wrk' command is used. The Grafana URL is obtained using 'kubectl', and the Istio dashboard is accessed in a browser to examine performance metrics for the Bookinfo services.