skillfed

google-cloud-profiler

Google Cloud Profiler Python Agent

google-cloud-profiler v4.1.0 419.2K downloads/30d#6,801 on PyPI32
Permissive license Apache License, Version 2.0 Active released

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-profiler

uv

uv add google-cloud-profiler

poetry

poetry add google-cloud-profiler

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9

Tags

python profiling agent gcpgoogle cloud profiler pythoncpu memory profiling cloudapplication performance profilingcontinuous profiling pythoncloud profiler integrationpython performance monitoring gcp
gcp-nativeperformance-profilingproduction-monitoring

More Monitoring packages

tqdm

Wraps any iterable to display a real-time…

copyleft · top 100 on PyPI

opentelemetry-semantic-conventions

Provides generated Python code for…

permissive · top 100 on PyPI

opentelemetry-sdk

Provides the reference implementation of the…

permissive · top 100 on PyPI

opentelemetry-api

Provides the abstract API and interfaces for…

permissive · top 100 on PyPI

opentelemetry-exporter-otlp-proto-http

Exports OpenTelemetry observability data to an…

permissive · top 1,000 on PyPI

opentelemetry-instrumentation

Provides automatic instrumentation commands and…

permissive · top 1,000 on PyPI

codeguru-profiler-agent

Integrates Python applications with Amazon…

permissive · top 5,000 on PyPI

google-python-cloud-debugger

Attaches a snapshot debugger agent to Python…

permissive · top 15,000 on PyPI

cloud-tpu-diagnostics

Collects stack traces and diagnostic data from…

unclear · top 15,000 on PyPI

pyroscope-io

Pyroscope-io is a continuous profiling agent…

permissive · top 5,000 on PyPI

scalene

Scalene profiles Python code to measure CPU,…

permissive · top 15,000 on PyPI

google-cloud-mldiagnostics

Collects metrics, configs, and performance…

permissive · top 15,000 on PyPI

py-spy

py-spy is a sampling profiler that attaches to…

permissive · top 1,000 on PyPI

aws-cdk.aws-codeguruprofiler

Provides AWS CDK constructs for defining and…

permissive · top 15,000 on PyPI

ppk2-api

Provides a Python API to automate power…

copyleft · top 15,000 on PyPI

line-profiler

line_profiler measures execution time on a…

permissive · top 5,000 on PyPI