このドキュメントでは、単一のコンテキストから 1 つのトレースにすべてのスパンを表示する方法について説明します。これは、これらのスパンが 1 つの組織内の異なる Google Cloud プロジェクトに保存されたアプリケーションによって生成された場合になります。
A と B という Google Cloud プロジェクトがあるケースで考えてみましょう。プロジェクト A によってホストされているアプリケーションにプロジェクト B が呼び出しを行うとします。Google Cloud Console を開いてプロジェクト A を選択すると、プロジェクト A によってホストされているアプリケーションが生成したトレーススパンしか表示できません。デフォルトの構成では、プロジェクト B がプロジェクト A に呼び出しを行うときに生成されるトレーススパンは表示されません。
プロジェクト B がプロジェクト A のコンテキストからプロジェクト A に呼び出しを行うときに生成されたトレーススパンを表示するには、Trace のプロジェクト間機能を使用します。この機能を使用すると、プロジェクト A のトレースデータを表示するときに、プロジェクト B がプロジェクト A に呼び出しを行うときに生成されたスパンも表示できます。
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["わかりにくい","hardToUnderstand","thumb-down"],["情報またはサンプルコードが不正確","incorrectInformationOrSampleCode","thumb-down"],["必要な情報 / サンプルがない","missingTheInformationSamplesINeed","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2024-12-21 UTC。"],[],[],null,["# View traces across projects\n\nBy default, the **Trace Explorer** page only searches your selected\nproject for trace data. When a trace has data stored in multiple projects,\nas might occur when an application in one project makes a call into\nan application hosted by another project, you need to perform\nthe following steps to view all spans in the trace:\n\n1. Create a trace scope that\n lists the Google Cloud projects that store the spans in a trace.\n For information about trace scopes, see\n [Create and manage trace scopes](/trace/docs/trace-scope/create-and-manage).\n\n2. Open the **Trace Explorer** page and set the scope to\n be the trace scope that you created in the previous step.\n For more information, see\n [Configure which projects are searched for span data](/trace/docs/finding-traces#refine-scope).\n\n Your Identity and Access Management (IAM) roles on the projects listed in the\n trace scope and the\n time-range setting determine what data is displayed. The trace scope\n only specifies which resources are searched.\n\n When the **Trace Explorer** page opens, it searches the\n resources listed in the [default trace scope](/stackdriver/docs/scopes/configure#default-scope),\n provided that scope is accessible. When that scope isn't accessible,\n your Google Cloud project is searched. You can set which\n trace scope is the default trace scope.\n\n| **Note:** The **Trace Explorer** and **legacy** **Trace Explorer** pages use different rules to search for trace data. The **Trace Explorer** page only searchs the projects you specify in a trace scope. In contrast, the **legacy** **Trace Explorer** page searches all projects in an organization. Because the **legacy** **Trace Explorer** page searches your organization, you can use it to help you identify the projects to add to your trace scope. For information about how to identify these projects, see [Migrate to trace scopes](/trace/docs/trace-scope/create-and-manage#migrate)."]]