DEV Community

Nikith Kaithalapuram
Nikith Kaithalapuram

Posted on

Exploring Log and Metric Data in Kubernetes

Introduction

Observability is critical to any cloud native application. In this tutorial, you will be able to get hands-on with observability in Kubernetes. You will practice retrieving various kinds of metric data from a Kubernetes cluster.

Overview

Welcome to TortoiseCorp! We work to build the future of fruit, lettuce, and heat lamps.

We have an application running in the cluster, and we want to be able to retrieve some data about the application so that we can better understand how it is performing. You will need to retrieve the requested data about the application.

This will help us make some decisions about how we can continue to build and optimize our code!
Enter fullscreen mode Exit fullscreen mode

Collect Logs from a Container

Collect logs from the container named lettuce from the Pod named food

kubectl logs food -c lettuce
Enter fullscreen mode Exit fullscreen mode

Terminal

Terminal

View Metric Data about Compute Resources Used by Pods

  • View metric data about the compute resource usage by the Pods in the default namespace:

kubectl top pods

top pods

  • From the list of Pods and their CPU usage, identify which Pod has the highest CPU usage by looking at the name of the Pod that has the highest value under CPU(cores).

Reference

https://app.pluralsight.com/

Top comments (0)