Cloud Trace overview

Cloud Trace, a distributed tracing system for Google Cloud, helps you understand how long it takes your application to handle incoming requests from users or other applications, and how long it takes to complete operations like RPC calls performed when handling the requests. Cloud Trace can also help you when you are developing a service or troubleshooting a failure. For example, it can help you understand how requests are processed in a complicated microservices architecture, and it might help you identify which logs to examine.

Because Cloud Trace receives latency data from some Google Cloud services, such as App Engine, and from applications instrumented with the Cloud Trace API, it can help you answer the following questions:

  • How long does it take my application to handle a given request?
  • Why is it taking my application so long to handle a request?
  • Why do some of my requests take longer than others?
  • What is the overall latency of requests to my application?
  • Has latency for my application increased or decreased over time?
  • What can I do to reduce application latency?
  • What are my application's dependencies?

If your curious about how you can use Cloud Trace to help you manage your applications, then read the blog Troubleshooting distributed applications: Using traces and logs together for root-cause analysis.

For information about profiling your application, see Cloud Profiler.

Environment support

Cloud Trace runs on Linux in the following environments:

Cloud Trace provides client libraries for instrumenting your application to capture trace information. For per-language setup instructions, see Instrument for Cloud Trace.

Configurations with automatic tracing

Some configurations result in automatic capture of trace data:

  • App Engine standard environment

    Java 8, Python 2, and PHP 5 applications don't need to use the Cloud Trace client libraries. These runtimes automatically send latency data to Cloud Trace for requests to application URIs. The requests include latency data for round-trip RPC calls to App Engine services. Cloud Trace works with all App Engine Admin APIs, with the exception of Cloud SQL.

  • Cloud Run functions and Cloud Run

    For incoming and outgoing HTTP requests, latency data is automatically sent to Cloud Trace.

Language support

The following table summarizes the availability of Trace client libraries and of OpenTelemetry libraries for which there is an exporter to Cloud Trace.

Language Client library
available
OpenTelemetry
lib/exporter available
C++ Yes Yes
C# ASP.NET Core Yes No
C# ASP.NET Yes No
Go Yes Yes
Java Yes Yes
Node.js Yes Yes
PHP Yes No
Python Yes Yes
Ruby Yes Yes

OpenTelemetry libraries are simpler to use than the Cloud Trace client libraries because they hide some of the complexity of the corresponding Trace API. For instrumentation recommendations, see Choose an instrumentation approach.

Components

Cloud Trace consists of a tracing client, which collects traces and sends them to your Google Cloud project. You can then use the Google Cloud console to view and analyze the data collected by the agent. For information about the data model, see Traces and spans.

Tracing client

If an OpenTelemetry library is available for your programming language, you can simplify the process of creating and sending trace data by using OpenTelemetry. In addition to being simpler to use, OpenTelemetry implements batching which might improve performance.

If an OpenTelemetry library doesn't exist, then instrument your code by importing the Trace SDK library and by using the Cloud Trace API. The Cloud Trace API sends trace data to your Google Cloud project.

Tracing interface

You can view and analyze your trace data in near real-time in the Cloud Trace interface.

The Trace Explorer page lets you examine an individual traces in detail. By default, this view displays a plot of the latency for all traces and lists, in a table, the most recent traces. You can select a trace to view more detailed information, such as the spans in the trace, the latency information for each span and for the trace, and links to logs and events. For information about filtering and viewing trace details, see Find and explore traces.

The Analysis reports page lets you to create custom reports. These reports can include all traces, or by specifying filters, only include a subset of traces. You can also create reports that compare two different sets of latency data. For more information, see Create and view reports.

Data security

Cloud Trace is a VPC Service Controls supported service. For more information, see VPC Service Controls documentation.

Pricing and usage

What's next