google-cloud-profiler
Google Cloud Profiler Python Agent
What it is and what it does
Google Cloud Profiler Python Agent is a daemon-based profiler that continuously collects CPU, memory, and wall-time profiles from running Python applications and uploads them to Google Cloud Profiler for centralized analysis. It integrates directly into your application startup with a single initialization call and runs as a background thread, requiring minimal code changes.
The package is designed for production workloads on Google Cloud Platform but can work in other environments by specifying a project_id. It has a native compiled component, making installation platform-dependent: Linux systems with glibc or musl are supported, and Alpine Linux requires additional build tools. The profiler supports Python versions from 3.7 through 3.11 and is actively maintained by Google Cloud Platform.
Use it for:
- Identify CPU hotspots and memory leaks in production Python services running on GCP without manual profiling.
- Continuously monitor application performance across multiple instances and correlate profiles with service versions.
- Debug performance regressions by comparing profiles across different service versions over time.
- Analyze resource consumption in containerized Python applications deployed on Google Cloud Run or GKE.
- Troubleshoot latency issues in long-running batch jobs or background workers on Compute Engine.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Collects and uploads CPU, memory, and wall-time profiles from Python applications running on Google Cloud Platform to Google Cloud Profiler for analysis and visualization.
Yes, if you run Python applications on Google Cloud Platform and need production profiling. The active maintenance, permissive license, and zero known vulnerabilities support adoption. However, the high install friction (native compilation, Linux-only, Alpine special handling) and Python version ceiling (3.11 max) mean it's not suitable for all environments. Verify your deployment platform and Python version before committing.
Install
google-cloud-profiler on PyPI
pip
pip install google-cloud-profileruv
uv add google-cloud-profilerpoetry
poetry add google-cloud-profilerInstalling google-cloud-profiler
Before you install
High install friction due to native compilation requirements. The package includes compiled components and requires build tools on Linux systems; Alpine Linux users must explicitly install build-base. Maintenance is active with recent commits, though the latest release was over a year ago.
License in practice
Licensed under Apache License, Version 2.0 (permissive). You may use, modify, and distribute this package freely in commercial and private projects, provided you include a copy of the license and note any changes made.
Quickstart
pip install google-cloud-profiler
import googlecloudprofiler
googlecloudprofiler.start(
service='my-service',
service_version='1.0.0',
verbose=2
)
Linux only (glibc or musl). Requires Python >= 3.7 and <= 3.11. Native compilation needed at install time; Alpine Linux requires build-base package. GCP credentials or project_id parameter required for operation.
Verify before relying
- Whether the package works on Python 3.12 or later despite classifier support ending at 3.11
- Current performance overhead of the daemon thread during continuous profiling
- Compatibility with non-GCP environments beyond the project_id workaround
Package facts
| License | Apache License, Version 2.0 (permissive) |
| Python support | not specified |
| Install friction | high — source build required |
| Runtime dependencies | none |
| Maintenance | actively maintained — 1,094 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 419,232/month — #6,801 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: google-cloud-profiler-4.1.0.tar.gz
Keywords: google, cloud, profiler
Tags
More Monitoring packages
Wraps any iterable to display a real-time…
copyleft · top 100 on PyPI
opentelemetry-semantic-conventionsProvides generated Python code for…
permissive · top 100 on PyPI
opentelemetry-sdkProvides the reference implementation of the…
permissive · top 100 on PyPI
opentelemetry-apiProvides the abstract API and interfaces for…
permissive · top 100 on PyPI
opentelemetry-exporter-otlp-proto-httpExports OpenTelemetry observability data to an…
permissive · top 1,000 on PyPI
opentelemetry-instrumentationProvides automatic instrumentation commands and…
permissive · top 1,000 on PyPI
codeguru-profiler-agentIntegrates Python applications with Amazon…
permissive · top 5,000 on PyPI
google-python-cloud-debuggerAttaches a snapshot debugger agent to Python…
permissive · top 15,000 on PyPI
cloud-tpu-diagnosticsCollects stack traces and diagnostic data from…
unclear · top 15,000 on PyPI
pyroscope-ioPyroscope-io is a continuous profiling agent…
permissive · top 5,000 on PyPI
scaleneScalene profiles Python code to measure CPU,…
permissive · top 15,000 on PyPI
google-cloud-mldiagnosticsCollects metrics, configs, and performance…
permissive · top 15,000 on PyPI
py-spypy-spy is a sampling profiler that attaches to…
permissive · top 1,000 on PyPI
aws-cdk.aws-codeguruprofilerProvides AWS CDK constructs for defining and…
permissive · top 15,000 on PyPI
ppk2-apiProvides a Python API to automate power…
copyleft · top 15,000 on PyPI
line-profilerline_profiler measures execution time on a…
permissive · top 5,000 on PyPI