> [!NOTE]
> **Note:** Developer Connect insights is [generally available](https://cloud.google.com/products#product-launch-stages) in all regions except `australia-southeast1`, `europe-west6`, `europe-west8`, `europe-west9`, and `southamerica-east1`.

This document describes how to take advantage of the intelligence provided by
Developer Connect insights.

## Before you begin

Before you can use Developer Connect insights, you need to follow the steps in
[Set up Developer Connect insights](https://docs.cloud.google.com/developer-connect/docs/set-up-insights).
The roles and permissions needed for Developer Connect insights are described in that
article.

## Use Developer Connect insights in Gemini Cloud Assist

You can
[use Gemini Cloud Assist](https://docs.cloud.google.com/cloud-assist/investigations)
to see the insights generated by Developer Connect insights.

When an investigation is created in Gemini Cloud Assist, the
system automatically picks up deployments relevant to your App Hub
application or within a project, depending on how you
[set it up](https://docs.cloud.google.com/developer-connect/docs/set-up-insights). When making diagnoses,
Gemini Cloud Assist uses these deployments as context.

When Gemini Cloud Assist correlates a deployment event with your
investigation, the system displays a card titled "Deployment
of `[DEPLOYMENT_NAME]`."

Click **Correlated Events** on the cards to open the relevant logs in Logs Explorer.

When Gemini Cloud Assist believes that a specific deployment is
causing an error, it includes that deployment as one of the hypotheses, with
title "Recent Deployment Impacting Application Behavior," along with
recommendations for remediation.

## View Developer Connect insights log entries

Because the insights created using Developer Connect insights are stored as log entries in
Cloud Logging, you can view deployment metadata in Logging. To
view log entries created by Developer Connect insights, use the `gcloud logging read`
command, filtering by log name, as follows:

    gcloud logging read logName=projects/PROJECT_ID/logs/developerconnect.googleapis.com/sdlc_deployment` \
    --project=PROJECT_ID

In this command, replace <var translate="no">PROJECT_ID</var> with the ID of the
project in which you
[created your Developer Connect insights config](https://docs.cloud.google.com/developer-connect/docs/set-up-insights#configure_dci).

This command returns logs with the name `sdlc_deployment`, but you can also
filter by other values, for example, your Developer Connect insights configuration ID
(`labels.insights_config_id=`) to show log entries for a specific insights
configuration.

The following is a sample of a JSON log entry produced by Developer Connect insights:

    {
      "insertId": "11h69plf2713tb",
      "jsonPayload": {
        "previousDeployment": {
          "resource": "//container.googleapis.com/projects/P/locations/L/clusters/dci-cluster",
          "deploymentId": "//container.googleapis.com/projects/P/locations/L/clusters/dci-cluster/k8s/namespaces/default/apps/replicasets/dci-test-app-c8cf94d46",
          "artifactDetails": [
            {
              "commitReferences": [
                {
                  "commitSha": "5460433ebfc4b2a7602e21f90828559b4891943e",
                  "commitUrl": "https://github.com/USER/REPO/commit/5460433ebfc4b2a7602e21f90828559b4891943e"
                }
              ],
              "packages": [
                {
                  "packageVersion": "3.40.1-2+deb12u1",
                  "packageName": "libsqlite3-0"
                },
                {
                  "packageVersion": "0.45.1",
                  "packageName": "wheel"
                },
              ],
              "artifactUri": "us-central1-docker.pkg.dev/P/R/dci-test-app-image@sha256:86ee1874886beb7d2042e40e3ff7253a974c579d49dbbfbba576aad13c880709"
            }
          ],
          "statusSummary": "1/1 Running",
          "timestamp": "2025-03-21T21:13:28Z"
        },
        "currentDeployment": {
          "resource": "//container.googleapis.com/projects/P/locations/L/clusters/dci-cluster",
          "statusSummary": "5/5 Running",
          "artifactDetails": [
            {
              "packages": [
                {
                  "packageVersion": "3.40.1-2+deb12u1",
                  "packageName": "libsqlite3-0"
                },
                {
                  "packageVersion": "0.45.1",
                  "packageName": "wheel"
                },
              ],
              "artifactUri": "us-central1-docker.pkg.dev/P/R/dci-test-app-image@sha256:86ee1874886beb7d2042e40e3ff7253a974c579d49dbbfbba576aad13c880709",
              "commitReferences": [
                {
                  "commitUrl": "https://github.com/USER/REPO/commit/5460433ebfc4b2a7602e21f90828559b4891943e",
                  "commitSha": "5460433ebfc4b2a7602e21f90828559b4891943e"
                }
              ]
            },
            {
              "artifactUri": "us-central1-docker.pkg.dev/P/R/dci-test-app-image@sha256:86ee1874886beb7d2042e40e3ff7253a974c579d49dbbfbba576aad13c880709",
              "packages": [
                           {
                  "packageVersion": "3.40.1-2+deb12u1",
                  "packageName": "libsqlite3-0"
                },
                {
                  "packageVersion": "0.45.1",
                  "packageName": "wheel"
                },
              ],
              "commitReferences": [
                {
                  "commitSha": "5460433ebfc4b2a7602e21f90828559b4891943e",
                  "commitUrl": "https://github.com/USER/REPO/commit/5460433ebfc4b2a7602e21f90828559b4891943e"
                }
              ]
            }
          ],
          "deploymentId": "//container.googleapis.com/projects/P/locations/L/clusters/dci-cluster/k8s/namespaces/default/apps/replicasets/recommendation-app-c8cf94d46",
          "timestamp": "2025-03-21T21:16:33Z"
        }
      },
      "resource": {
        "type": "k8s_cluster",
        "labels": {
          "location": "us-central1",
          "project_id": "REDACTED",
          "cluster_name": "REDACTED"
        }
      },
      "timestamp": "2025-03-21T21:16:33Z",
      "severity": "INFO",
      "labels": {
        "insights_config_id": "projects/P/locations/L/insightsConfigs/ecommerce-699",
        "insights_config_deployment_id": "projects/P/locations/L/insightsConfigs/ecommerce-699/deployments/ee54cbae-08f4-4970-a61b-bc28740572c7"
      },
      "logName": "projects/P/logs/developerconnect.googleapis.com%2Fsdlc_deployment",
      "receiveTimestamp": "2025-03-21T21:18:01.154658625Z",
      "apphub": {
        "application": {
          "container": "projects/dci-test-project-3",
          "location": "us-central1",
          "id": "dci-test-app"
        },
        "workload": {
          "id": "dci-test-app",
          "environmentType": "PRODUCTION",
          "criticalityType": "MISSION_CRITICAL"
        }
      }
    }

## View Developer Connect insights deployment events

In addition to viewing insights using Logging, you can see
deployment events and their details using the Google Cloud console or the
Google Cloud CLI.

> [!NOTE]
> **Note:** viewing deployment events using Google Cloud console is available for App Hub-enabled folders only.

### List deployment events

### Google Cloud console

(For App Hub-enabled folders only.)

To list deployment events for a given insights configuration, using the
Google Cloud console, perform the following steps:

1. In the Google Cloud console, select **Cloud Hub** from
   the main menu.

   The Cloud Hub main page is displayed.
2. Select **Deployments**.

   Deployed applications are listed **Application code deployment updates**
   table.

   You can select any listed application to view its details.

### gcloud

To list deployment events for a given insights configuration, run the
following command:

    gcloud alpha developer-connect insights-configs deployment-events list \
           --insights-config=INSIGHTS_CONFIG_ID \
           --location=LOCATION \
           --project=PROJECT_ID

Replace the following:

- <var translate="no">INSIGHTS_CONFIG_ID</var> is the name that was given to the
  Developer Connect insights configuration when it was
  [created](https://docs.cloud.google.com/developer-connect/docs/set-up-insights#configure_dci).

- <var translate="no">LOCATION</var> is the region in which you created your
  Developer Connect insights configuration.

- <var translate="no">PROJECT_ID</var> is the ID of the Google Cloud project in which
  you created the insights configuration.

The following is a sample JSON output from the `deployment-events list`
command, showing deployment events produced by Developer Connect insights:

    [
      {
        "artifactDeployments": [
          {
            "artifactAlias": "us-central1-docker.pkg.dev/my-project/my-registry/my-app@sha256:1234567890",
            "artifactReference": "us-central1-docker.pkg.dev/my-project/my-registry/my-app@sha256:1234567890",
            "containerStatusSummary": "Running-N/A : 1",
            "deployTime": "2025-10-20T16:10:48Z",
            "id": "0a9b8c7d6e5f4g3h2i1",
            "sourceCommitUris": [
              "https://github.com/myGitHub/my-GitHub-project/commit/5806255405d"
            ]
          }
        ],
        "deployTime": "2025-10-20T16:10:48Z",
        "name": "projects/111111111/locations/us-central1/insightsConfigs/my-ic/deploymentEvents/daf0987654321",
        "runtimeConfig": {
          "uri": "//container.googleapis.com/projects/111111111/locations/us-central1/clusters/my-cluster/k8s/namespaces/default/apps/deployments/my-deployment"
        },
        "runtimeDeploymentUri": "//container.googleapis.com/projects/111111111/locations/us-central1/clusters/my-cluster/k8s/namespaces/default/apps/replicasets/my-deployment-6c74f4cdbb",
        "state": "STATE_ACTIVE"
      },
      {
        "artifactDeployments": [
          {
            "artifactAlias": "us-central1-docker.pkg.dev/my-project/my-registry/my-app@sha256:24680",
            "artifactReference": "us-central1-docker.pkg.dev/my-project/my-registry/my-app@sha256:24680",
            "containerStatusSummary": "Terminated-Error (Exit Code: 137) : 1",
            "deployTime": "2025-10-20T15:29:32Z",
            "id": "2a4b6c8d0e",
            "sourceCommitUris": [
              "https://github.com/myGitHub/my-GitHub-project/commit/n6f8e1269f2c18"
            ],
            "undeployTime": "2025-10-20T18:46:47Z"
          }
        ],
        "deployTime": "2025-10-20T15:29:32Z",
        "name": "projects/111111111/locations/us-central1/insightsConfigs/my-ic/deploymentEvents/nkj987654321",
        "runtimeConfig": {
          "uri": "//container.googleapis.com/projects/111111111/locations/us-central1/clusters/my-cluster/k8s/namespaces/default/apps/replicasets/my-deployment"
        },
        "runtimeDeploymentUri": "//container.googleapis.com/projects/111111111/locations/us-central1/clusters/my-cluster/k8s/namespaces/default/apps/replicasets/my-deployment-6c74f4cdbb",
        "state": "STATE_INACTIVE",
        "undeployTime": "2025-10-20T18:46:47Z"
      }
    ]

### View deployment-event details

### Google Cloud console

(For App Hub-enabled folders only.)

To view the deployment details for a deployed application, in the
Google Cloud console, do the following:

1. [List the deployment events](https://docs.cloud.google.com/developer-connect/docs/use-insights#list-deployment-events) for your selected
   project.

2. Click the name of the application whose details you want to view.

The details are shown in the Google Cloud console.

### gcloud

To view deployment-event details for a given insights configuration,
including vulnerabilities, run the following command:

    gcloud alpha developer-connect insights-configs deployment-events describe DEPLOYMENT_EVENT_ID \
           --insights-config=INSIGHTS_CONFIG_ID \
           --location=LOCATION \
           --project=PROJECT_ID

Replace the following:

- <var translate="no">DEPLOYMENT_EVENT_ID</var> is a unique identifier for the deployment
  event.

  You can get this ID from the list of events returned from the `gcloud
  alpha developer-connect insights-configs deployment-events list` command.
  The ID is at the end of the path in the `name:` element for the event. For
  example, in the following deployment event JSON, the event ID is
  `nkj987654321`:

      "name": "projects/111111111/locations/us-central1/insightsConfigs/my-ic/deploymentEvents/nkj987654321"

- <var translate="no">INSIGHTS_CONFIG_ID</var> is the name that was given to the
  Developer Connect insights configuration when it was
  [created](https://docs.cloud.google.com/developer-connect/docs/set-up-insights#configure_dci).

- <var translate="no">LOCATION</var> is the region in which you created your
  Developer Connect insights configuration.

- <var translate="no">PROJECT_ID</var> is the ID of the Google Cloud project in which
  you created the insights configuration.

The following is a sample JSON output from the `deployment-events describe`
command, showing details for the deployment event, produced by
Developer Connect insights:

    {
      "artifactDeployments": [
        {
          "artifactAlias": "us-central1-docker.pkg.dev/my-project/my-registry/my-app@sha256:1234567890",
          "artifactReference": "us-central1-docker.pkg.dev/my-project/my-registry/my-app@sha256:1234567890",
          "containerStatusSummary": "Running-N/A : 1",
          "deployTime": "2025-12-02T01:04:30Z",
          "id": "0a9b8c7d6e5f4g3h2i1",
          "packages": [
            {
              "name": "abc",
              "version": "1.3.4.20250131-1"
            },
            {
              "name": "defg",
              "version": "4.3.0"
            },
          ],
          "sourceCommitUris": [
            "https://github.com/myGitHub/my-GitHub-project/commit/5806255405d"
          ],
          "vulnerabilities": [
            "CVE-2000-1234",
            "CVE-2001-1234",
            "CVE-2002-1234",
            "CVE-2003-1234",
            "CVE-2004-1234",
          ]
        }
      ],
      "deployTime": "2025-12-02T01:04:30Z",
      "name": "projects/111111111/locations/us-central1/insightsConfigs/my-ic/deploymentEvents/daf0987654321",
      "runtimeConfig": {
        "uri": "//container.googleapis.com/projects/111111111/locations/us-central1/clusters/my-cluster/k8s/namespaces/default/apps/deployments/my-deployment"
      },
      "runtimeDeploymentUri": "//container.googleapis.com/projects/111111111/locations/us-central1/clusters/my-cluster/k8s/namespaces/default/apps/replicasets/my-deployment-6c74f4cdbb",
      "state": "STATE_ACTIVE"
    }

## What's next

- [Learn more](https://docs.cloud.google.com/cloud-assist/investigations) about Gemini Cloud Assist investigations