This is the second in a series of blog posts on monitoring Kubernetes. Read Part 1 to get a better understanding of Kubernetes components and open-source tools for collecting Kubernetes metrics. 


In the previous part of our blog series, we covered the basics of Kubernetes architecture and components, as well as various open-source options for collecting monitoring data from a Kubernetes cluster. Here, we’ll review how you can collect and visualize key Kubernetes metrics in SignalFx.

End-to-End Visibility for Microservices on Kubernetes

SignalFx integrates with every layer of your environment to provide end-to-end observability for Kubernetes environments:

  • The SignalFx Smart Agent deploys as a DaemonSet in your kubernetes cluster and collect high-resolution, real-time metrics from Docker, Kubernetes, the underlying hosts, and the services in your containers.
  • Smart Agent automatically discovers the microservices running in containers and configures metrics for supported SignalFx integrations, giving immediate visibility into your environment.
  • Charts and alerts in SignalFx update in seconds so they can more accurately track the dynamic behavior of Kubernetes Pods.
  • Microservices APM enables directed troubleshooting of microservices, guiding you from an alert to the root cause of issues by correlating metrics and traces across the stack.

Collecting Kubernetes Metrics with SignalFx

Integrating with a Cloud Provider

For basic monitoring of a Kubernetes cluster managed by a cloud provider, SignalFx can integrate directly with services like AWS CloudWatch and Google Stackdriver to collect data. This is relatively straightforward and lets you collect Kubernetes metrics without having to install an agent. However, these services are typically configured by default to report metrics at relatively infrequent intervals (typically every 5 minutes), and don’t necessarily provide insight into the specific services deployed on your Kubernetes clusters.

Collecting from Prometheus Exporters

Prometheus is a fairly common starting point for people who want to get visibility into their Kubernetes metrics. SignalFx can scrape metrics from a Prometheus exporter endpoint, making it incredibly easy to send metrics to SignalFx if you already have exporters deployed in your Kubernetes cluster.

SignalFx also automatically changes Prometheus metric types to their equivalents in SignalFx, and converts Prometheus labels into SignalFx dimensions so that you can continue to easily group and filter Kubernetes metrics with metadata.

Using the SignalFx Smart Agent

The SignalFx Smart Agent is our open-source metrics collection agent. Built around collectd, the Smart Agent discovers services running in your Kubernetes environment, and will automatically configure monitoring content for those dashboards. The Smart Agent runs as a daemonset (a copy per node in your Kubernetes cluster), with each instance of the Smart Agent monitoring services running on those same nodes.

Additionally, the Smart Agent has the ability to report metrics at up to 1-second resolution, making it particularly suited for the ephemeral and dynamic nature of Kubernetes environments.

Installing the agent requires just three steps:

  1. Store a SignalFx Access Token as a Kubernetes Secret
  2. Configure the Kubernetes daemonset and SignalFx Smart Agent to work with your cluster
  3. Run commands on your Kubernetes cluster to install the Smart Agent and start streaming metrics into SignalFx

First, store a SignalFx Access Token as a key named access-token in a Kubernetes secret named signalfx-agent, using the following command:

$ kubectl create secret generic --from-literal access-token=MY_ACCESS_TOKEN signalfx-agent

To configure the Kubernetes daemonset and SignalFx Smart Agent to work with your cluster and automatically discover SignalFx-supported integrations to monitor, you’ll need to download and modify a number of .yaml files from our Github repository to the machine you usually run kubectl from:

Once you’ve modified these according to the instructions in our documentation, run the following commands on your Kubernetes cluster to install the Smart Agent, making sure to include the path to each .yaml file you downloaded and modified:

$ kubectl create -f configmap.yaml \

                 -f daemonset.yaml \

                 -f serviceaccount.yaml \

                 -f clusterrole.yaml \

                 -f clusterrolebinding.yaml  # BE SURE TO CHANGE MY_AGENT_NAMESPACE IN THIS FILE FIRST

If you use Helm, simply follow these instructions to add our SignalFx Helm chart repository and install the Smart Agent in your cluster.

Verifying Smart Agent Install and Discovering your services

The Smart Agent is preconfigured to include most of the integrations that SignalFx supports out of the box, and will automatically discover and monitor the microservices running in your containers. Each integration has a default configuration that you can further customize to your environment using rules based on the container image name and service port.

To quickly see what services an instance of the Smart Agent has discovered, run the command signalfx-agent stats endpoints.  

Navigating Your Kubernetes Environment

Use the Infrastructure Navigator to get an immediate view of your entire Kubernetes architecture, colored by critical health metrics. Dashboards are populated with metrics emitted from the Smart Agent’s kubernetes-cluster and kubelet-stats monitor, but you can also quickly drill down and across elements of your environment, from the infrastructure to the orchestrator, containers, and applications.

Overview

The Kubernetes Overview provides a heatmap of every Kubernetes cluster you are monitoring in SignalFx, as well as a dashboard showing the number of clusters, nodes and containers for each, and aggregated system metrics (CPU, disk, memory, network) across all of these nodes.

kubernetes cluster dashboards

Hovering over the cluster name highlights related resources or views that you can quickly navigate to:

kubernetes drill down

Node view

You can also view your nodes together, instead of grouping them by the cluster they’re a part of – this view lets you assess the health of the infrastructure supporting your Kubernetes cluster.

kubernetes node view

As with Overview, the heatmap is colored by one of several key metrics (CPU Utilization is the default), and you can hover over a node to see additional data or drill down.

Pod view

Selecting Kubernetes Pods shows all of the pods running in your Kubernetes clusters. You can track activity across a particular pod or across all pods, using the same dynamic filtering and grouping in the Nodes view.

kubernetes pods view

From any of the individual pods in this view, you can drill down to the Docker containers, navigate to the Kubernetes node hosting that pod, or view the node in other contexts.

Docker Containers View

This shows each of the Docker containers reporting to SignalFx from your environment.

docker container dashboard

Navigating here from the Pod view will show just the containers in a single pod, but you can also group and filter your containers by Kubernetes-related dimensions.

containers in kubernetes pod

Start Monitoring Kubernetes

Kubernetes has emerged as the de-facto standard for orchestrating containerized microservices, but presents new monitoring requirements. SignalFx delivers real-time visibility into Kubernetes clusters and the services deployed in them, and provides operators with the ability to respond to issues in real-time.

If you’re not already using SignalFx, get started with a 14-day trial, or schedule a demo to learn more.         



About the authors

Aaron Sun

Aaron Sun works in product marketing at SignalFx. Previously, he was responsible for enterprise sales development at SignalFx, HackerRank, and Oracle.

Enjoyed this blog post? Sign up for our blog updates