google-cloud-trace
Google Cloud Trace API client library
What it is and what it does
google-cloud-trace is the official Python client library for Google Cloud Trace, a distributed tracing service that collects and visualizes latency data across your application. It lets you send trace spans directly to Cloud Trace for applications running outside App Engine, complementing the automatic tracing available for App Engine deployments. The library wraps the Trace API and handles authentication, serialization, and transport via gRPC.
The package is built on standard Google Cloud client infrastructure (google-api-core, google-auth, grpcio, proto-plus, protobuf) and supports Python 3.10 and later. It is actively maintained and widely used (top 5000 on PyPI). The documentation recommends OpenTelemetry for application instrumentation rather than direct API calls, so this library is typically used either for custom tracing workflows or as a backend for OpenTelemetry exporters.
Use it for:
- Send custom trace spans from microservices running on Compute Engine or GKE to visualize request flow and latency.
- Instrument batch jobs or background workers to track execution time and dependencies across distributed tasks.
- Export traces from on-premises or multi-cloud applications to a centralized Google Cloud Trace dashboard.
- Integrate with OpenTelemetry collectors to export trace data to Cloud Trace from any instrumented application.
- Debug performance bottlenecks by correlating trace spans with Cloud Logging and Cloud Monitoring data.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Sends application trace data to Google Cloud Trace for distributed tracing and performance monitoring. Provides direct API access to the Trace service for applications outside App Engine.
Yes, if you are running applications on Google Cloud and need direct access to the Trace API or are building custom tracing workflows. The library is production-stable, actively maintained, and has no known vulnerabilities. Install friction is low. If your primary goal is application instrumentation, the documentation recommends OpenTelemetry instead. Permissive Apache-2.0 license poses no restrictions for most use cases.
Install
google-cloud-trace on PyPI
pip
pip install google-cloud-traceuv
uv add google-cloud-tracepoetry
poetry add google-cloud-traceInstalling google-cloud-trace
Before you install
Low friction install with a pure-Python wheel. Actively maintained as of 2026-08-14 with recent releases. Depends on standard Google Cloud libraries (google-api-core, google-auth, grpcio, proto-plus, protobuf), all widely used and stable.
License in practice
Apache-2.0 permissive license allows commercial and private use with minimal restrictions; you must include a copy of the license and state significant changes.
Quickstart
pip install google-cloud-trace
from google.cloud import trace_v2
client = trace_v2.TraceServiceClient()
# Use client to send spans to Cloud Trace
Requires Python >= 3.10. Requires Google Cloud authentication (service account key or Application Default Credentials) and an active Google Cloud project with Cloud Trace enabled.
Verify before relying
- Whether OpenTelemetry integration is recommended over direct API use for most applications.
- Performance overhead of trace collection and transmission in high-throughput scenarios.
- Compatibility with non-Google Cloud observability backends or hybrid tracing setups.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 5 — google-api-core, google-auth, grpcio, proto-plus, protobuf |
| Maintenance | actively maintained — 53 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 12,269,201/month — #1,328 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: google_cloud_trace-1.20.0-py3-none-any.whl
Tags
More Internet packages
Botocore provides low-level, data-driven access…
permissive · top 100 on PyPI
aiobotocoreProvides an async client for AWS services using…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
filelockProvides a platform-independent file locking…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
googleapis-common-protosProvides common Protocol Buffer message…
permissive · top 100 on PyPI
google-cloud-monitoringPython client library for Google Cloud…
permissive · top 1,000 on PyPI
google-cloud-appengine-loggingClient library for Google Cloud AppEngine…
permissive · top 1,000 on PyPI
google-cloud-monitoring-dashboardsPython client library for Google Cloud…
permissive · top 15,000 on PyPI
google-cloud-loggingWrites log entries to Google Cloud Logging and…
permissive · top 1,000 on PyPI
google-cloud-tasksPython client library for Google Cloud Tasks,…
permissive · top 1,000 on PyPI
google-cloud-bigquery-loggingPython client library for Google Cloud BigQuery…
permissive · top 15,000 on PyPI
google-cloud-billingProgrammatic access to Google Cloud Platform…
permissive · top 15,000 on PyPI
google-cloud-error-reportingClient library for Google Cloud Error Reporting…
permissive · top 5,000 on PyPI
google-cloud-service-usageProvides a Python client for Google Cloud…
permissive · top 15,000 on PyPI
google-cloud-service-controlPython client library for Google Cloud Service…
permissive · top 15,000 on PyPI