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.
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:
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:
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.
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:
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.
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:
Find a trace by selecting Stackdriver > Trace > Trace List in the Google Cloud Platform Console, or click the following button:
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:
The trace results list and scatter plot will be based on the currently selected project only and not for other projects in the trace.
View Trace Details by clicking any request URI in the Trace List. The trace details appear below:
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.
- 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.