Discovering Latency with Google Cloud Trace

45 minutes
  • 4 Learning Objectives

About this Hands-on Lab

Latency is one of Google Cloud’s Four Golden Signals when it comes to Service Level Indicators – and it’s easy to see why. When an application suffers from increased latency, the user experience is a highly negative one: suddenly what was regarded as a reliable application becomes, at best, suspect and, at worst, dismissed as unreliable. Google Cloud’s Cloud Trace makes it possible for developers and SREs to keep a close eye on latency analytics. In this hands-on lab, you’ll create the infrastructure for the app and then trigger it so you can see how Cloud Trace works, first-hand.

Learning Objectives

Successfully complete this lab by achieving the following learning objectives:

Set up Necessary Infrastructure
  1. Create the needed Kubernetes cluster and work with existing YAML files to create a Docker image of an app and push it to the Container Registry.
Deploy a Python App With Additional Services
  1. Customize a bash script and then run it to deploy the app and three load balancers.
Execute a Request
  1. Using Cloud Shell, execute a curl command in the proper syntax to send a request to one of the load balancers and begin the tracing.
Review Cloud Trace Analytics
  1. Identify traces and spans resulting from the submitted request and response and review the latency data.

Additional Resources

The team is setting up a Kubernetes Engine hosted Python app that relies on passing requests among three different load balancers. Before full deployment, you have been tasked with running a test to review the latency demonstrated when the app executes.

You’ll need to accomplish the following steps to complete your task:

  1. Enable the necessary APIs (Kubernetes Engine API and the Cloud Trace API. The Cloud Trace API has replaced the Stackdriver Trace API).
  2. Retrieve the working files.
  3. Create a Kubernetes Engine cluster.
  4. Create a Docker image and push it to Container Registry
  5. Run a batch script to set up three interconnected services.
  6. Execute a command to trigger the app.
  7. Review the Cloud Trace analytics.

Note: The source code can be found in the lab GitHub repo: https://github.com/ACloudGuru-Resources/content-gcpro-operations.git

What are Hands-on Labs

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?