# Optimization

In Optimization, it is possible to have an overview of the identified optimization opportunities, displaying information such as Applications, Cluster Name, Container, Namespace, and Application Type. It also allows you to enable or disable the optimization and download a report.

**How to access Optimization:**

1. In Kubernetes, select the **Optimization** option:

<figure><img src="https://1687673077-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZ9sinLUl52lDK1vg6b8g%2Fuploads%2FOUpDVliUgthLEVDBFrhQ%2Fimage.png?alt=media&#x26;token=7e14018a-7d47-45ed-b366-b286d4b04df5" alt=""><figcaption></figcaption></figure>

2. The system will display the optimization screen with the option to apply some filter fields:

* By clicking the **Filters** icon, as highlighted below:

<figure><img src="https://1687673077-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZ9sinLUl52lDK1vg6b8g%2Fuploads%2F7gjvJ9x2D9U3FV7QjSKf%2Fimage.png?alt=media&#x26;token=fcfb3001-8c5b-4934-a279-c3d3f152710a" alt=""><figcaption></figcaption></figure>

* The system will display all label options collected from the observability platform, allowing you to apply the desired filter field:

<figure><img src="https://1687673077-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZ9sinLUl52lDK1vg6b8g%2Fuploads%2FTHgUPctDJTj1Fsimpm61%2Fimage.png?alt=media&#x26;token=db7cfb7d-0bb1-4903-974f-5b3fa13ecfdd" alt=""><figcaption></figcaption></figure>

* When selecting the desired field, it will be possible to provide more information about the filter field, such as:
  * **Enable negative expressions**, in case you want to work with a different result than the one provided.
  * **Greater than**: In this case, you must provide the reference value so the system will return options greater than it.
  * **Less than**: In this case, you must provide the reference value so the system will return options less than it.
  * **Greater than or equal to**: In this case, you must provide the reference value so the system will return options greater than or equal to it.
  * **Less than or equal to**: In this case, you must provide the reference value so the system will return options less than or equal to it.

<figure><img src="https://1687673077-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZ9sinLUl52lDK1vg6b8g%2Fuploads%2FEsOtw6qieKliFr2iq4n3%2Fimage.png?alt=media&#x26;token=8a9bf8e9-4b79-4384-ad3a-b461e8a4b44e" alt=""><figcaption></figcaption></figure>

* By clicking the **Save** button, the system will display the added filter:

<figure><img src="https://1687673077-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZ9sinLUl52lDK1vg6b8g%2Fuploads%2FMOraQAlrbxkOGBOgQLmY%2Fimage.png?alt=media&#x26;token=89098d5a-91eb-4fc7-a41f-0ec17c78c390" alt=""><figcaption></figcaption></figure>

3. By clicking the **Metrics** option, the system allows you to select the metric options you want to view in the Rightsizing report:

<figure><img src="https://1687673077-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZ9sinLUl52lDK1vg6b8g%2Fuploads%2FaFHC5P8oys6M9dIjoiFW%2Fimage.png?alt=media&#x26;token=043955a0-24d5-45bd-a281-a9c8f7fcd222" alt=""><figcaption></figcaption></figure>

4. In the **Download Report** option, by clicking the "![](https://1687673077-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZ9sinLUl52lDK1vg6b8g%2Fuploads%2FNvW3ArPCxh5Zau95Rzfj%2Fimage.png?alt=media\&token=eb424730-9135-441a-ae86-397204169797)" icon, the system will extract a CSV report.

<figure><img src="https://1687673077-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZ9sinLUl52lDK1vg6b8g%2Fuploads%2FUA7oAX6pkCUShGZ2Pyw3%2Fimage.png?alt=media&#x26;token=89ed51d8-fc45-4b57-a443-80730dbbf262" alt=""><figcaption></figcaption></figure>

7. Further down, you can view a chart of **Actions and Estimated Savings**:
   * The **green bar** displays performance actions.
   * The **orange bar** displays savings actions.
   * The **red line** shows the estimated savings.

<figure><img src="https://1687673077-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZ9sinLUl52lDK1vg6b8g%2Fuploads%2FzDHNHgQSVkzDNIqTA94f%2Fimage.png?alt=media&#x26;token=9d490366-c124-40a5-ac5b-c4209d358c28" alt=""><figcaption></figcaption></figure>

7. Further below, a report will be presented containing the list of optimization opportunities related to the indicated applications:

<figure><img src="https://1687673077-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZ9sinLUl52lDK1vg6b8g%2Fuploads%2FGPREsiZGzcyZ6a5JdyMt%2Fimage.png?alt=media&#x26;token=7b24d2e3-2370-4ec5-866b-2e2d0f9ba087" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}
The system only allows enabling or disabling optimizations that have an agent installed in the cluster. When no agent is installed, the optimization will remain disabled.
{% endhint %}

This report will contain basic information such as the ones listed below, in addition to the metrics presented at the beginning of the page:

* Optimization (flag allowing you to enable or disable optimization)
* Application
* Cluster Name
* Container
* Namespace
* Application Type

8. By clicking the application name in blue, the system will open the **Optimization Details** screen, with the option to apply a filter by period:

<figure><img src="https://1687673077-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZ9sinLUl52lDK1vg6b8g%2Fuploads%2FCI1BrbguvUDZpbBJnkEH%2Fimage.png?alt=media&#x26;token=adeb0455-1dd4-4c0b-9821-19bd34f82af3" alt=""><figcaption></figcaption></figure>

By clicking the period, the system allows you to set the desired period, and then you will need to click **Reload** so the filter can be applied:

<figure><img src="https://1687673077-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZ9sinLUl52lDK1vg6b8g%2Fuploads%2FvE91x8kaqE0rbKDK2eik%2Fimage.png?alt=media&#x26;token=cb334b0b-d731-4f07-bf70-7419f94eb3f0" alt=""><figcaption></figcaption></figure>

8. Additionally, the system presents the following detailed information about the Resource:

* Cluster Name
* Application
* Namespace
* Application Type
* Container
* Allocated Cost
* Total Utilized Cost (CPU and Memory)
* Estimated Savings
* Optimization (flag allowing you to enable or disable optimization)

{% hint style="warning" %}
Whenever an optimization conflict is detected, when an automation in the cluster is already managing the workload resources, the system will stop the agent’s operation and display an alert message informing about the existing conflict and the need for manual action so the agent can be reactivated.

{% endhint %}

<figure><img src="https://1687673077-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZ9sinLUl52lDK1vg6b8g%2Fuploads%2FaKd3TUvdy2puvp6drEAy%2Fimage.png?alt=media&#x26;token=0e6bce1f-c937-4760-8902-bb682f7571a9" alt=""><figcaption></figcaption></figure>

9. Further below, information about **CPU, Memory, and Actions** for the selected application will be presented.

#### CPU Information:

* By clicking the **CPU** tab, the system will present the following information:
  * CPU Request
  * CPU Utilization (MAX)
  * CPU Limit
  * Allocated CPU Cost
  * Utilized CPU Cost
  * CPU Recommendation
  * Estimated CPU Savings

<figure><img src="https://1687673077-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZ9sinLUl52lDK1vg6b8g%2Fuploads%2FkTLGM9KybDXyF2B3LI7X%2Fimage.png?alt=media&#x26;token=7514783c-7e2b-4efd-82eb-23aac015bac5" alt=""><figcaption></figcaption></figure>

* Further below, a chart of **Utilized vs. Allocated CPU Cost** will be displayed, representing the utilized and allocated CPU cost during the selected period.
  * The green area represents the Allocated CPU Cost
  * The pink area represents the Utilized CPU Cost
  * The yellow line represents the Estimated Rightsizing Value

<figure><img src="https://1687673077-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZ9sinLUl52lDK1vg6b8g%2Fuploads%2Fz74sovSiYMls4nWfEorW%2Fimage.png?alt=media&#x26;token=81711cae-488a-4b16-a425-15da6de67907" alt=""><figcaption></figcaption></figure>

* Scrolling further down, the system will display a **CPU Utilization chart in millicores**:
  * The blue area represents the CPU Request
  * The pink area represents the CPU Utilization
  * The yellow line represents the Rightsizing Recommendation

<figure><img src="https://1687673077-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZ9sinLUl52lDK1vg6b8g%2Fuploads%2FQ71QZdDzp53jAL5a07w2%2Fimage.png?alt=media&#x26;token=65ddd685-6228-4f17-ac38-7082f49fdb5f" alt=""><figcaption></figcaption></figure>

* In the upper-right corner, the system also allows switching from **MAX (maximum)** to **AVG (average)**, enabling navigation between average and maximum for applications with many CPU usage peaks.

<figure><img src="https://1687673077-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZ9sinLUl52lDK1vg6b8g%2Fuploads%2FvlEimCwFMK9OdLywPaSq%2Fimage.png?alt=media&#x26;token=663f6b00-3c4d-4f34-985f-df881dc8f593" alt=""><figcaption></figcaption></figure>

#### Memory Information:

* By clicking the **Memory RAM** tab, the system will present the following information:
  * Memory Request
  * Memory Utilization (MAX)
  * Memory Limit
  * Allocated Memory Cost
  * Utilized Memory Cost
  * Memory Recommendation
  * Estimated Memory Savings

<figure><img src="https://1687673077-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZ9sinLUl52lDK1vg6b8g%2Fuploads%2FiY4uTwPa1mBu1UrWBAwM%2Fimage.png?alt=media&#x26;token=b49b1d86-a72b-4283-8a0c-c552a533ff6a" alt=""><figcaption></figcaption></figure>

* Further below, a chart of **Utilized vs. Allocated Memory Cost** will be displayed, representing the utilized and allocated memory cost during the selected period.
  * The green area represents the Allocated Memory Cost
  * The pink area represents the Utilized Memory Cost
  * The yellow line represents the Estimated Rightsizing Value

<figure><img src="https://1687673077-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZ9sinLUl52lDK1vg6b8g%2Fuploads%2FZGH8tEUjMpjxcSOjhLwF%2Fimage.png?alt=media&#x26;token=403e90e0-8e50-4003-8ae6-c8478ee70962" alt=""><figcaption></figcaption></figure>

* Scrolling further down, the system will display a **Memory Utilization chart in GB**:
  * The blue area represents the Memory Request
  * The pink area represents the Memory Utilization
  * The yellow line represents the Rightsizing Recommendation

<figure><img src="https://1687673077-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZ9sinLUl52lDK1vg6b8g%2Fuploads%2Fe2hceGoLa3BXXwESyt4H%2Fimage.png?alt=media&#x26;token=9ff2d495-10ad-4c03-9923-bbf0c277251f" alt=""><figcaption></figcaption></figure>

* In the upper-right corner, the system also allows switching from **MAX (maximum)** to **AVG (average)**, enabling navigation between average and maximum for applications with many memory usage peaks.

<figure><img src="https://1687673077-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZ9sinLUl52lDK1vg6b8g%2Fuploads%2Fq3N0wPpLI8oCvZ05Vlqs%2Fimage.png?alt=media&#x26;token=6f79c518-c807-4081-965e-4b52220b1ba4" alt=""><figcaption></figcaption></figure>

#### Action Information:

* By clicking the **Actions** tab, the system will present the following information whenever an optimization is activated:
  * Before Action
  * After Action
  * Action Date
  * Action Type
  * Status
  * Cost Deviation

<figure><img src="https://1687673077-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZ9sinLUl52lDK1vg6b8g%2Fuploads%2FqZYfdWEe7svDOOzAH9BA%2Fimage.png?alt=media&#x26;token=4c15e142-219a-4ad1-8e3a-3376c2bd9a0e" alt=""><figcaption></figcaption></figure>
