# Prometheus

## Overview

#### Agentless Kubernetes Cost Management

Finout’s solution for managing container costs is entirely agentless, reducing security risks and eliminating performance overhead. It automatically detects Kubernetes usage and waste across any Kubernetes resource, whether running on Amazon EKS, Google GKE, or Azure AKS - and enriches your cost data for precise visibility and optimization. Finout integrates with Prometheus, supporting both Per-Cluster and Centralized Prometheus monitoring tools.&#x20;

#### How the Agentless Architecture Works

Unlike traditional agent-based tools that run continuously and consume cluster resources, Finout uses a scheduled, read-only cronjob that runs periodically to collect Kubernetes metrics from your clusters, using Prometheus querying.

**Key benefits of this design:**

* *Non-intrusive:* No Finout components are installed in your cluster, and no Kubernetes resources are modified by Finout.
* *Periodic collection:* metrics are gathered based on a user-configured schedule, minimizing resource impact.
* *External storage:* collected metrics are stored in your configured S3 bucket; nothing is written directly to your cluster.
* *Minimal setup:* works seamlessly with your existing Prometheus infrastructure without requiring elevated permissions or persistent components.\
  \
  This lightweight approach maintains both system security and operational efficiency, while providing a reliable cost visibility across all your Kubernetes environments.

#### **This integration supports both metric collection methods**:

* [**Per-Cluster Prometheus Monitoring**](https://docs.finout.io/kubernetes-integrations/kubernetes/prometheus/prometheus-per-cluster-integration):\
  Integrate Finout with the Prometheus instance in each of your monitored clusters.

  Each Cost Center’s configuration determines how the Finout Metrics Exporter CronJob collects metrics. The CronJob will be set up to gather data from every monitored cluster according to its associated Cost Center configuration.<br>

  *How do I integrate multiple clusters*?

  * Apply the [cronjob YAML](https://docs.finout.io/kubernetes-integrations/kubernetes/prometheus-per-cluster-integration#example-yaml) to every cluster that shares the same configuration. All of them will write to the same S3 bucket and prefix.
  * If you want different S3 locations (buckets/prefixes), create additional Prometheus integrations.<br>
* **Centralized Prometheus Compatible Monitoring Tools:** \
  Centralized Prometheus Monitoring tools aggregate metrics from multiple Kubernetes clusters into a single, unified monitoring system with a central Prometheus-compatible API.

  To integrate Centralized Prometheus Monitoring tools into Finout, create a single Prometheus integration that connects to that tool’s  centralized API, by selecting the specific tool you’re using:

  * [Amazon Managed Prometheus](https://docs.finout.io/kubernetes-integrations/kubernetes/prometheus/centralized-prometheus-monitoring-tool-integrations/amazon-managed-prometheus-integration-beta) (Beta)
  * [Chronosphere](https://docs.finout.io/kubernetes-integrations/kubernetes/prometheus/centralized-prometheus-monitoring-tool-integrations/chronosphere-integration-beta) (Beta)
  * [Coralogix](https://docs.finout.io/kubernetes-integrations/kubernetes/prometheus/centralized-prometheus-monitoring-tool-integrations/coralogix-integration)
  * [Mimir](https://docs.finout.io/kubernetes-integrations/kubernetes/prometheus/centralized-prometheus-monitoring-tool-integrations/mimir-integration)
  * [Thanos](https://docs.finout.io/kubernetes-integrations/kubernetes/prometheus/centralized-prometheus-monitoring-tool-integrations/thanos-integration)
  * [VictoriaMetrics](https://docs.finout.io/kubernetes-integrations/kubernetes/prometheus/centralized-prometheus-monitoring-tool-integrations/victoriametrics-integration) <br>

    <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p><strong>Note</strong>: Finout integrates seamlessly with all clusters you have connected to the selected centralized tool.</p></div>

## How the Integration Works

Finout's Kubernetes Prometheus cost integration follows a simple, three-step process:

1. **Metrics Export**: Finout’s cronjob exports container metrics from your Kubernetes clusters using per-cluster or centralized metrics monitoring on scheduled periods.
2. **Metrics Storage**: All the exported metrics and the cronjob’s logs are written to your configured S3 bucket (i.e., `s3://<S3_BUCKET>/<S3_PREFIX>/<CLUSTER_NAME>/…`)
3. **Cost Enrichment**: Finout processes your stored metrics, validating and normalizing them, then enriches your cloud billing data with these metrics to provide cost analysis that supports Kubernetes-level abstraction and granularity i.e., (namespaces, workloads, and labels).

## Prerequisites

Before integrating your Kubernetes clusters with Finout, ensure the following requirements are met:

* **Working Prometheus Deployment**: A functioning Prometheus instance, server, or Prometheus-compatible monitoring system.
* **Cluster Labeling**: Ensure your metrics include a cluster label to distinguish between different clusters in multi-cluster environments
* **Kubernetes Metrics Scraping**: Prometheus must be configured to scrape Kubernetes metrics using `kube-state-metrics`&#x20;
  * The version must be 2.0.0 or higher.
* **Finout fetches these metrics** from your Prometheus endpoint:

<table><thead><tr><th>Prometheus Metric</th><th width="121.34765625">Required</th><th>Purpose</th></tr></thead><tbody><tr><td><code>kube_node_info</code></td><td>Yes</td><td>Required to calculate Cost Allocation. This metric enables the connection of nodes and pods to billing.</td></tr><tr><td><code>container_cpu_usage_seconds_total</code></td><td>Yes</td><td>Actual container CPU usage.</td></tr><tr><td><code>container_memory_working_set_bytes</code></td><td>Yes</td><td>Actual container memory usage.</td></tr><tr><td><code>kube_node_status_capacity{resource="cpu"}</code></td><td>Yes</td><td>Node CPU cores capacity.</td></tr><tr><td><code>kube_node_status_capacity{resource="memory"}</code></td><td>Yes</td><td>Node memory capacity.</td></tr><tr><td><code>kube_pod_container_resource_requests{resource="cpu"}</code></td><td>Yes</td><td>Pod/container CPU requests improve accuracy and enable rightsizing recommendations in CostGuard.</td></tr><tr><td><code>kube_pod_init_container_resource_requests{resource="cpu"}</code></td><td>Yes</td><td>Improves accuracy by collecting CPU requests from initContainers. Relevant especially when the <a href="https://kubernetes.io/docs/concepts/workloads/pods/sidecar-containers/#pod-sidecar-containers">initContainers running as sidecars</a>. </td></tr><tr><td><code>kube_pod_container_resource_requests{resource="memory"}</code></td><td>Yes</td><td>Pod/container memory improves accuracy and enables rightsizing recommendations in CostGuard.</td></tr><tr><td><code>kube_pod_init_container_resource_requests{resource="memory"}</code></td><td>Yes</td><td>Improves accuracy by collecting memory requests from initContainers. Relevant especially when the <a href="https://kubernetes.io/docs/concepts/workloads/pods/sidecar-containers/#pod-sidecar-containers">initContainers running as sidecars</a>. </td></tr><tr><td><code>container_network_receive_bytes_total</code></td><td>Yes</td><td>Container incoming network usage.</td></tr><tr><td><code>container_network_transmit_bytes_total</code></td><td>Yes</td><td>Container outgoing network usage.</td></tr><tr><td><code>kube_pod_labels</code></td><td>Recommended</td><td>Enables filtering/grouping by pod labels.</td></tr><tr><td><code>kube_node_labels</code></td><td>Recommended</td><td>Enables filtering/grouping by node labels.</td></tr><tr><td><code>kube_namespace_labels</code></td><td>Recommended</td><td>Enables filtering/grouping by namespace labels.</td></tr><tr><td><code>kube_pod_info</code></td><td>Recommended</td><td>Needed to allocate costs to higher-level K8s objects (deployment, statefulset, daemonset, cronjob) instead of just pods.</td></tr><tr><td><code>kube_replicaset_owner</code></td><td>Recommended</td><td>Allows rolling pod costs up to deployments accurately.</td></tr><tr><td><code>kube_job_owner</code></td><td>Recommended</td><td>Allows rolling pod costs up to cronjob definitions rather than individual jobs.</td></tr></tbody></table>

## Next Steps

Once you've verified your prerequisites and ensured the required metrics are exposed, proceed to the integration guide for your specific monitoring tool:

* [Per-Cluster Prometheus Integration](https://docs.finout.io/kubernetes-integrations/kubernetes/prometheus/prometheus-per-cluster-integration)
* [Centralized Prometheus](https://docs.finout.io/kubernetes-integrations/kubernetes/prometheus/centralized-prometheus-monitoring-tool-integrations) Monitoring Tool Integration (Coralogix, Thanos, Mimir, VictoriaMetrics)

For additional support, consult our [FAQ](https://docs.finout.io/kubernetes-integrations/kubernetes/prometheus/prometheus-faqs) and [Troubleshooting](https://docs.finout.io/kubernetes-integrations/kubernetes/prometheus/prometheus-troubleshooting) section or contact Finout support at <support@finout.io>.

For new updates to the Prometheus Exporter introduced between versions and their impact on cost calculation, refer to the Metrics Exporter [release notes](https://docs.finout.io/kubernetes-integrations/kubernetes/prometheus/prometheus-metrics-exporter-release-notes).

<br>
