Cloud Trace overview

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

Because Trace receives latency data from some Google Cloudservices, such asApp Engine, and fromapplications instrumented with theCloud 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 manageyour applications, then read the blogTroubleshooting distributed applications: Using traces and logs together for root-cause analysis.

For information about profiling your application,seeCloud Profiler.

Environment support

Trace runs on Linux in the following environments:

Trace provides client libraries for instrumenting yourapplication to capture trace information. For per-language setup instructions,seeInstrument 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 theTrace client libraries. These runtimes automatically sendlatency data to Trace for requests to application URIs.The requests include latency data for round-trip RPC calls toApp Engine services. Trace works with allApp Engine Admin APIs, with the exception of Cloud SQL.

  • Cloud Run functions and Cloud Run

    For incoming and outgoing HTTP requests, latency data is automaticallysent to Trace.

Language support

Note:You can instrument your application so that it collectsapplication-specific information. Several open-sourceinstrumentation frameworks let you collect metrics, logs, andtraces from your application and send that data to any vendor,including Google Cloud. To instrument your application, we recommend that you use avendor-neutral instrumentation framework that is open source, such asOpenTelemetry, instead ofvendor- and product-specific APIs or client libraries.

For information about instrumenting your applications by usingvendor-neutral instrumentation frameworks, see Instrumentation and observability.

The following table summarizes the availability of Traceclient libraries and ofOpenTelemetrylibraries for which there is an exporter to Trace.

LanguageClient library
available
OpenTelemetry
lib/exporter available
C++YesYes
C# ASP.NET CoreYesNo
C# ASP.NETYesNo
GoYesYes
JavaYesYes
Node.jsYesYes
PHPYesNo
PythonYesYes
RubyYesYes

OpenTelemetrylibraries are simpler to use than the Trace client librariesbecause they hide some of the complexity of the correspondingTrace API. For instrumentation recommendations, seeChoose an instrumentation approach.

Components

Trace consists of a tracing client, which collectstraces andsends them to your Google Cloud project. You can then use theGoogle Cloud console to view and analyze the data collected by the agent.For information about the data model, seeTraces and spans.

Tracing client

If an OpenTelemetry library isavailable for your programminglanguage, you can simplify the process of creating andsending trace data by usingOpenTelemetry.In addition to being simpler to use, OpenTelemetryimplements batching which might improve performance.

If an OpenTelemetry library doesn't exist, then instrument your code byimporting 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 datain near real-time in the Trace interface.

To view and analyze your span data, you can use theTrace Explorer andLog Analytics pages in theGoogle Cloud console:

  • Trace Explorer: Displays aggregate information aboutyour trace data and lets you examine individual traces in detail. Theaggregated latency data is shown on a heatmap, which you can explore withyour pointer. To restrict which data is displayed, you can add filters.This page also lets you view and explore individual spans and traces:

  • Log Analytics: This page lets you run queries that perform an aggregateanalysis of your spans by using SQL. Your SQL queries can also joinyour trace and log data. You can view theresults of your query in tabular form or with charts.If you create a linked dataset, then you can useBigQueryto analyze your spans. For more information, seeQuery and analyze traces.

VPC Service Controls support

Trace is a VPC Service Controls supported service. TheTrace service name iscloudtrace.googleapis.com. AnyVPC Service Controls restrictions that you create for theTrace service apply only to that service. Those restrictionsdon't apply to any other services, including those like thetelemetry.googleapis.com service,which can also ingest trace data.

For more information, see the following:

Cloud Trace and data residency

If you are usingAssured Workloadsbecause you have data-residency orImpact Level 4 (IL4) requirements,then don't use the Cloud Trace API to send trace spans.

Pricing

To learn about pricing for Cloud Trace, see theGoogle Cloud Observability pricing page.

What's next

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2026-02-19 UTC.