Cloud Trace visualizes request paths through distributed systems. Identify latency bottlenecks in microservices architectures and understand service dependencies.
What is Cloud Trace?
Cloud Trace is Google’s distributed tracing service for performance analysis. A trace follows a request through all involved services: from API gateway through backend services to the database. You see exactly which service takes how long.
With latency problems, Cloud Trace immediately shows which service call causes the bottleneck. Instead of searching through logs, you see the entire request chain visually.
Core Features
- Trace Visualization: Waterfall view of all service calls
- Latency Analysis: P50, P95, P99 latency distributions
- Service Dependencies: Automatic service map
- Sampling: Automatic or configured sampling
- OpenTelemetry: Standard protocol for vendor-independent instrumentation
Trace Anatomy
A trace consists of spans. Each span represents an operation:
Request (Root Span, 450ms)
├── API Gateway (20ms)
├── Auth Service (80ms)
├── Backend Service (300ms)
│ ├── Cache Lookup (5ms) - MISS
│ ├── Database Query (180ms) ← Bottleneck!
│ └── Response Build (15ms)
└── Response Serialization (50ms)Typical Use Cases
Latency Debugging
An API endpoint is suddenly slow. Cloud Trace shows that the database call takes 10x longer than normal. Without tracing, you would have had to investigate each service individually.
Service Dependency Mapping
With complex microservices architectures, Cloud Trace automatically shows which services call which others. The service map visualizes dependencies.
SLO Monitoring
Define SLOs (99% of requests under 200ms) and monitor compliance. Cloud Trace integrates with Cloud Monitoring for alerting on SLO violations.
Cloud Trace vs. Cloud Profiler vs. Cloud Logging
| Tool | Focus | Granularity | Use Case |
|---|---|---|---|
| Cloud Trace | Request latency | Service calls | “Which service is slow?” |
| Cloud Profiler | CPU/Memory | Functions | “Which function consumes CPU?” |
| Cloud Logging | Events | Log entries | “What happened?” |
Benefits
- Automatic Instrumentation: GCP services send traces automatically
- OpenTelemetry: Vendor-neutral standard, no lock-in
- Free for Most: 2.5M spans/month included
- Integrated: Native linkage with Logging and Monitoring
Integration with innFactory
As a Google Cloud Partner, innFactory supports you with Cloud Trace: OpenTelemetry setup, instrumentation of existing services, and performance optimization based on trace data.
Typical Use Cases
Technical Specifications
Frequently Asked Questions
What is Cloud Trace?
Cloud Trace is a distributed tracing service that follows request paths through distributed systems. You see how long each service call takes and where bottlenecks occur. Traces visualize the entire chain from API gateway to database.
How does Cloud Trace differ from Cloud Profiler?
Cloud Trace analyzes request latency and shows where time is spent in distributed systems (between services). Cloud Profiler shows which functions within a service consume CPU and memory (within the code). Both complement each other.
How much does Cloud Trace cost?
The first 2.5 million spans per month are free. Beyond that, $0.20 per million spans. For most applications, the free quota is sufficient.
What instrumentation does Cloud Trace support?
Cloud Trace supports OpenTelemetry (recommended), OpenCensus, and Zipkin. GCP services like Cloud Run, App Engine, and GKE automatically send traces. For your own services, use OpenTelemetry SDKs.
How long are traces stored?
Traces are stored for 30 days. For longer retention, export to BigQuery or Cloud Storage. Sampling reduces data volume for high-frequency applications.
