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. 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 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 you're curious about how you can use 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
Trace runs on Linux in the following environments:
- Compute Engine
- Google Kubernetes Engine (GKE)
- App Engine flexible environment
- App Engine standard environment
- Cloud Run
- Non-Google Cloud environments
Trace provides client libraries for instrumenting your application to capture trace information. For per-language setup instructions, see Instrument for 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 Trace client libraries. These runtimes automatically send latency data to Trace for requests to application URIs. The requests include latency data for round-trip RPC calls to App Engine services. 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 Trace.
Language support
The following table summarizes the availability of Trace client libraries and of OpenTelemetry libraries for which there is an exporter to 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 Trace client libraries because they hide some of the complexity of the corresponding Trace API. For instrumentation recommendations, see Choose an instrumentation approach.
Components
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 Trace interface.
The Trace Explorer page displays aggregate information about your trace data and lets you examine individual traces in detail. The aggregated latency data is shown on a heatmap, which you can explore with your pointer. To restrict which data is displayed, you can add filters. This page also lets you view and explore individual spans and traces:
- For information about how to view trace data stored in multiple projects, see Create and manage trace scope.
- For information about filtering and viewing your trace data, 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
Trace is a VPC Service Controls supported service. The
Trace service name is cloudtrace.googleapis.com
. Any
VPC Service Controls restrictions that you create for Trace apply
only to the Trace service. Those restrictions don't apply to any
other services.
For information about VPC Service Controls, see VPC Service Controls documentation.
For a list of supported services and limitations, see Supported products and limitations.
Pricing and usage
For information about how to view your current or past usage, see View usage by billing account.
For pricing information, see Google Cloud Observability pricing.
What's next
Try the Quickstart.
For information about quotas and limits, see Quotas and limits.
Read our resources about DevOps and explore the DevOps Research and Assessment research program.