Viewing traces across projects

This page provides details on setting up Stackdriver Trace so that you can see trace spans for related Google Cloud Platform (GCP) projects in one view.

Getting started

You can set up Stackdriver Trace to show trace spans from projects calling into your target project as well as trace spans from other projects servicing requests for your target project.

To view trace spans across GCP projects, do the following:

  1. Associate your GCP projects with the same organization.

    • If you are creating a new project in the context of the organization, it is automatically created under the organization resource.

      You can see the organization in which you are creating your project in the New Project panel:

      Stackdriver Trace list

    • If you have a GCP project that is not part of an organization, you can move it into your organization. See Migrating existing projects for details.

  2. Make sure you have the Cloud Trace User IAM role and Logging Viewer IAM role for each of the applications' projects.

  3. Make sure you have the resourcemanager.organizations.get permission for read access to the projects' organization. This permission is part of the Organization Viewer IAM role.

    To test whether you have this permission, open the project selector at the top of the GCP Console and make sure you can see a drop-down menu of organizations in the top left:

    Stackdriver Trace organization view

  4. Set up two or more applications that make calls to and from your target project and that run in different projects within the organization. If you already have applications running in multiple projects in the same organization that you would like to trace, you can use those.

  5. Configure the applications to write traces to the projects in which they are hosted.

Viewing trace details across projects

Once you have completed the Getting Started steps, do the following:

  1. Find a trace by selecting Stackdriver > Trace > Trace List in the Google Cloud Platform Console, or click the following button:

    Go to the Trace List page

    Make sure you have selected your target project in the top-left menu bar.

    It can take a few minutes for traces to appear the first time you use Stackdriver Trace. See Finding traces for more details.

    The screenshot below shows the Trace List page:

    Stackdriver Trace list

    The trace results list and scatter plot will be based on the currently selected project only and not for other projects in the trace.

  2. View Trace Details by clicking any request URI in the Trace List. The trace details appear below:

    Stackdriver Trace details

    When you view the trace details, you will see trace spans from all the projects associated with the trace, not only the traces spans for the currently selected target project.

  3. Click on any blue bar, which represents a trace span, in the Timeline panel. This opens a Details panel to the right of the Timeline panel. You can see which Project label is associated with the trace span and view related details.

Was this page helpful? Let us know how we did:

Send feedback about...

Stackdriver Trace Documentation