Insights from [Cloud Hub](https://docs.cloud.google.com/hub/docs/overview.md.txt) and
[Gemini Cloud Assist](https://docs.cloud.google.com/cloud-assist/overview.md.txt) help you identify
opportunities to optimize your applications. For example, you can review
recommendations to resize underutilized virtual machines or configure
Cloud CDN to reduce latency and cost.

After you analyze an existing application, you can use
[Application Design Center](https://docs.cloud.google.com/application-design-center/docs/overview.md.txt) to model
and deploy the recommended architectural changes.

## Before you begin

This document assumes you have
[set up a folder-level application management boundary](https://docs.cloud.google.com/app-hub/docs/set-up-app-hub-folder.md.txt)
for your applications. Application Design Center, Cloud Hub, and
Gemini Cloud Assist require this boundary type.

You must complete the following steps before using application insights and
assistance services:

- **For administrators**:

  1. Enable required APIs for all Google Cloud resources you intend to use.
  2. [Set up Application Design Center](https://docs.cloud.google.com/application-design-center/docs/setup.md.txt). Only required if you intend to create new application components from [templates](https://docs.cloud.google.com/app-hub/docs/key-concepts.md.txt#template).
  3. [Set up Cloud Hub](https://docs.cloud.google.com/hub/docs/setup-cloud-hub.md.txt). Only required if you intend to use Cloud Hub to identify optimization opportunities.
  4. [Set up Gemini Cloud Assist](https://docs.cloud.google.com/cloud-assist/set-up-gemini.md.txt). Only required if you intend to use Gemini Cloud Assist to identify optimization opportunities.
  5. [Grant access to users](https://docs.cloud.google.com/resource-manager/docs/manage-applications.md.txt#assign-roles). Assign appropriate IAM roles based on user's responsibilities in the application lifecycle.
- **For developers and operators**:

  1. Confirm that applications exist within your [application management boundary](https://docs.cloud.google.com/app-hub/docs/key-concepts.md.txt#app-mgmt-boundary).
  2. [Make sure you have the necessary IAM roles](https://docs.cloud.google.com/resource-manager/docs/manage-applications.md.txt#assign-roles) for the tasks you want to perform.
  3. Open your [management project](https://docs.cloud.google.com/app-hub/docs/key-concepts.md.txt#mgmt-project) in the Google Cloud console.

## Analyze the application for optimization opportunities

Use [Cloud Hub](https://docs.cloud.google.com/hub/docs/overview.md.txt) and
[Gemini Cloud Assist](https://docs.cloud.google.com/cloud-assist/overview.md.txt) to get a
consolidated view of your application's operational data and receive
recommendations:

1. In the Google Cloud console, use the project picker to select your management project.
2. Navigate to the **Home** page from Cloud Hub:


   [Go to Home](https://console.cloud.google.com/cloud-hub/home)

   <br />

3. Select your application to view its integrated dashboard.

4. Review incidents, alerts, performance metrics, and cost trends. For more
   information, see
   [Application views and project views](https://docs.cloud.google.com/hub/docs/app-project-views.md.txt).

5. Optionally,
   [use the Gemini Cloud Assist panel](https://docs.cloud.google.com/cloud-assist/chat-panel.md.txt)
   to ask for optimization recommendations using natural language prompts,
   for example:

   - `Give me recommendations to optimize my application.`
   - `Show me the most expensive resources with the lowest utilization for this application.`

   Gemini Cloud Assist provides recommendations, such as resizing
   underutilized machine types or enabling a Cloud CDN.

## Evolve the application architecture

After identifying an optimization, use
[Application Design Center](https://docs.cloud.google.com/application-design-center/docs/overview.md.txt) to model
and deploy the improved architecture:

- **If the application was deployed from a template:** [Open the template and modify its architecture](https://docs.cloud.google.com/application-design-center/docs/design-application-templates.md.txt#revise_and_reshare_your_template) based on the recommendations. You can then [deploy the new version](https://docs.cloud.google.com/app-hub/docs/create-applications-from-templates.md.txt) as an update to the existing application instance.
- **If the application wasn't deployed from a template:** [Create a new template](https://docs.cloud.google.com/app-hub/docs/create-reusable-template.md.txt) in Application Design Center that reflects the optimized architecture.

[Deploy the optimized application architecture](https://docs.cloud.google.com/application-design-center/docs/deploy-from-console).
This process might involve updating an existing deployment or creating a new
one, depending on the nature of the changes.