
准备工作
- 实验会创建一个 Google Cloud 项目和一些资源,供您使用限定的一段时间
- 实验有时间限制,并且没有暂停功能。如果您中途结束实验,则必须重新开始。
- 在屏幕左上角,点击开始实验即可开始
Create a cluster and deploy the sample application
/ 15
Create a cloud trace
/ 15
In this lab, you learn how to use Cloud Trace by sending an HTTP request to the sample application.
Learn how to use Trace by doing the following:
For each lab, you get a new Google Cloud project and set of resources for a fixed time at no cost.
Click the Start Lab button. If you need to pay for the lab, a pop-up opens for you to select your payment method. On the left is the Lab Details panel with the following:
Click Open Google Cloud console (or right-click and select Open Link in Incognito Window if you are running the Chrome browser).
The lab spins up resources, and then opens another tab that shows the Sign in page.
Tip: Arrange the tabs in separate windows, side-by-side.
If necessary, copy the Username below and paste it into the Sign in dialog.
You can also find the Username in the Lab Details panel.
Click Next.
Copy the Password below and paste it into the Welcome dialog.
You can also find the Password in the Lab Details panel.
Click Next.
Click through the subsequent pages:
After a few moments, the Google Cloud console opens in this tab.
In this task, you download a sample application from GitHub, enable the Google Kubernetes Engine API, create a GKE cluster, update cluster credentials, verify access, and deploy the application's three services.
To download and deploy the sample application, do the following:
After a few moments, a Cloud Shell session opens inside the Google Cloud console.
This command takes a few minutes to complete. After it completes successfully, your Google Cloud project contains the GKE cluster named cloud-trace-demo. You must have permission to create clusters that have external access in your Google Cloud project.
A sample output of this command is:
The script setup.sh configures three services of the application using a pre-built image. The workloads are named cloud-trace-demo-a, cloud-trace-demo-b, and cloud-trace-demo-c. The setup script waits for all resources to be provisioned, so the configuration might take several minutes to complete.
A sample output of this command is:
Click Check my progress to verify the objective.
In this task, you generate traces by sending curl
requests cloud-trace-demo-a and then view the trace data in Trace.
The output looks like the following:
In the Google Cloud console, go to Navigation menu () View all products → Observability → Trace → Trace Explorer, where you’ll see the Span ID (If not, rerun the curl command, refresh, and wait for the Span ID to appear.).
You can execute the curl command multiple times to generate multiple traces, and the Span ID may take a few minutes to appear.
Click Check my progress to verify the objective.
Trace shows distributed traces for analysis. It displays a heatmap of span durations over time, along with a table of individual spans, filterable by service name, span name, status, duration, and kind. The interface allows users to investigate performance issues and understand request flow within a distributed system.
The chart view displays the duration of spans over time using a heatmap. Each colored block represents a span, and its color intensity indicates its duration. This allows you to quickly identify slow spans or trends in latency.
In the chart view, click one of the darker span blocks.
In the Spans table, click any Span ID. A detailed breakdown of the specific trace is displayed. Each horizontal bar represents the duration of each span within the trace. The length of the bar corresponds to the span's duration.
This section of the trace provides a detailed view of a single request's journey through the system, breaking it down into individual operations (spans) and showing their timing and relationships. It helps pinpoint performance bottlenecks and understand the sequence of events.
Additional details about each span are shown in the details pane below.
In this lab, you performed the following tasks:
Good job.
When you have completed your lab, click End Lab. Google Cloud Skills Boost removes the resources you’ve used and cleans the account for you.
You will be given an opportunity to rate the lab experience. Select the applicable number of stars, type a comment, and then click Submit.
The number of stars indicates the following:
You can close the dialog box if you don't want to provide feedback.
For feedback, suggestions, or corrections, please use the Support tab.
Copyright 2022 Google LLC All rights reserved. Google and the Google logo are trademarks of Google LLC. All other company and product names may be trademarks of the respective companies with which they are associated.
此内容目前不可用
一旦可用,我们会通过电子邮件告知您
太好了!
一旦可用,我们会通过电子邮件告知您
一次一个实验
确认结束所有现有实验并开始此实验