Instana

Instana

The community for performance and observability professionals to learn, to share ideas, and to connect with others.

 View Only

Integrating Kubecost with Instana for comprehensive Kubernetes cost and performance monitoring

By Chinmayi Panicker posted 28 days ago

  

Author : @Chinmayi Panicker

Co-author : @Sunjit Tara

Kubecost is a tailored solution designed for managing and optimizing costs within Kubernetes ecosystems.  It offers thorough, real-time data on resource usage, spending trends, and related costs. With its ability to provide granular insights into expenses across clusters, namespaces, and specific workloads, Kubecost empowers teams to pinpoint inefficiencies, assign costs precisely, and execute strategic improvements. By actively controlling Kubernetes-related expenses, businesses can substantially cut down on superfluous costs and guarantee optimal resource utilization.

Instana is a comprehensive Application Performance Monitoring (APM) and Observability platform that enables organizations to monitor, manage, and optimize the performance of their applications and infrastructure in real-time. Instana automatically discovers components, and captures detailed metrics and traces across complex environments. Instana offers advanced, real-time Kubernetes monitoring capabilities, enabling deep observability into Kubernetes environments, including clusters, pods, containers, nodes, and associated applications. Integrating Kubernetes monitoring with Kubecost monitoring in Instana involves leveraging the strengths of both platforms to deliver comprehensive observability and cost optimization within Kubernetes environments.

Site Reliability Engineers (SREs) are responsible for making cost-conscious decisions and minimizing wastage where possible. This responsibility is further complicated by the intricacies of multi-cloud, distributed environments. By integrating infrastructure costs and usage costs into Instana, SREs are not only made cost-aware but also empowered to correlate any performance deviations, new releases, or changes associated with cost spikes.

This blog post guides you through the process of integrating your Kubecost setup with Instana, with both the Instana agent and Kubecost installed within the same Kubernetes cluster. For more information about Kubernetes monitoring using Instana, see Monitoring Kubernetes.

Architecture

Instana-Kubecost integration architeture

The diagram depicts the integration of Instana and Kubecost to deliver combined observability and cost insights within a Kubernetes environment. Kubecost is installed within the cluster to track resource usage and compute related costs. Meanwhile, an Instana Agent  is deployed within the same cluster to monitor the health and performance of applications and infrastructure. The key component in this setup is the Instana Kubecost Sensor, which fetches cost data via the Kubecost APIs. The Instana Kubecost sensor runs within the Instana agent, forwards cost metrics to the Instana backend and UI. As a result, Instana users can access cost data directly from their Kubernetes cluster dashboard. This integration benefits both technical and financial stakeholders by consolidating resource efficiency and application observability into a single interface.

Configuring Kubecost sensor

For monitoring kubecost, you must add the following configuration to the agent configuration :

Kubecost sensor configuration

If you use the free or enterprise version of Kubecost, you can configure the clusters parameter in the Instana configuration to control the clusters that are monitored. You can use one of the following methods to monitor Kubecost:

·      Static cluster list: Provide a predefined list of cluster names that you want Instana to monitor through Kubecost.

·      Automatic detection: You might also choose to exclude the clusters parameter. In this case, the Instana Kubecost sensor automatically detects and monitors all clusters that Kubecost monitors.

Note: Make sure that the cluster names that are specified in the configuration exactly match the cluster names as monitored by Instana. A mismatch prevents proper cost data association.

You must need an API key in the configuration, if authentication is enabled for your Kubecost deployment.

After the integration is successfully configured, you need to navigate to the Kubernetes Cluster Dashboard in Instana UI. Then, you must click the cluster name and view the metrics on the Cost tab. You can now view cost metrics that are associated with your Kubernetes resources.

Viewing cost metrics in Instana

The Kubecost metrics dashboard provides valuable insights into the cost of your Kubernetes resources. The Kubecost sensor collects the following key metrics:

  • Cost by Namespace: This metric highlights the cost distribution across various namespaces that helps you identify the high-cost workloads.
  • Cost by Deployment: This metric displays a detailed breakdown of costs associated with each deployment within the cluster.
Cost summary chart 
Cost by namespace 
Cost by deployment

Additional features

The following features enhance the visibility and equip teams with the necessary tools to scrutinize and enhance Kubernetes expenditure optimization:

  • View in Kubecost: Provides direct access to the Kubecost UI from Instana that allows you to explore more granular cost insights and visualizations within the native Kubecost interface.
  • Export to CSV: Exports cost metrics to a CSV file that enables in-depth analysis and easier sharing of cost data beyond the dashboard.
  • Smart Alerts: Assist in enforcing cost controls and cost management when cost thresholds are exceeded.


#Kubernetes

0 comments
20 views

Permalink