Cloud Profiler documentation
Cloud Profiler is a statistical, low-overhead profiler that continuously gathers CPU usage and memory-allocation information from your production applications. It attributes that information to the application's source code, helping you identify the parts of the application consuming the most resources, and otherwise illuminating the performance characteristics of the code.
Start your next project with $300 in free credit
Build and test a proof of concept with the free trial credits and free monthly usage of 20+ products.
Documentation resources
Resources
Related resources
Related videos
Process a Cloud Audit Logging log entry
Shows how to process an Audit Log entry.
Environment variables
Demonstrates how to use environment variables within a Cloud Function.
Avoid infinite retries in Cloud Functions
This sample demonstrates how to avoid infinite retries in Cloud Functions by only executing within a certain time period after the triggering event.
Trigger function from Cloud Logging
Triggers a function based on Cloud Logging entries.
React to value change by updating a value
Updates a value whenever it is changed in Firestore.
Execution after HTTP response
Example of code that won't execute after an HTTP response is sent.
Deploy Cloud Function 2nd gen with Cloud Storage trigger using Terraform
Full terraform config to deploy an event-driven Cloud Function 2nd gen with resources
Avoid infinite retries
Discards all events older than 10 seconds.
Cloud Storage (2nd Gen)
Process a Cloud Storage event using Cloud Functions (2nd Gen) and Eventarc
PHP Info
Get PHP info
Cached library
HTTP Cloud Function that uses a cached client library instance to reduce the number of connections required per function invocation.
Cloud Functions: Greeting Function
This sample demonstrates how to create a Cloud Function that accepts a first name and last name as input, and returns a personalized greeting message.
Pub/Sub publish message
Demonstrates how to interact with Pub/Sub from Cloud Functions.
Use HTTP connection pooling
Shows how to recycle HTTP connections using HTTP connection pools.
HTTP Hello World - Get
Function that prints "Hello world!" in response to a GET request.
Cloud Storage integration tests
Demonstrates how to integration test a function triggered by Cloud Storage.
Firebase Remote Config Change Trigger
This sample demonstrates how to trigger a Cloud Function when a Firebase Remote Config value changes.
Cloud Functions (1st Gen): Pub/Sub Hello World
Example Pub/Sub-triggered function that runs on Cloud Functions (1st Gen).
Send HTTP requests
Shows how to make an HTTP request from a Cloud Function.
Execution after timeout
Sample that demonstrates code that should (but won't) execute after a GCF call times out.
Listen to Firebase Realtime Database changes
This function is triggered by a change to a Firebase Realtime Database reference. It prints the source of the change, the data, and the delta.
Node.js: terminate HTTP connection
Show how to terminate an HTTP connection in Node.js
Write structured Logging in Cloud Functions
This sample demonstrates how to write structured logs in Cloud Functions using the Google Cloud logging client. Structured logs provide a more detailed and organized way to record information about your application, making it easier to troubleshoot and analyze issues.
Cloud Storage (1st Gen) Hello World
Example Storage-triggered function that runs on Cloud Functions (1st Gen).
Write logs
Writes a Cloud Functions log entry.
File system
Shows how to access a Cloud Functions instance's file system.
Cloud Pub/Sub (2nd Gen) Unit Test
Example unit test for a Cloud Pub/Sub-triggered function running on Cloud Functions (2nd Gen).
Cloud Pub/Sub (2nd Gen)
Process a Cloud Pub/Sub message using Cloud Functions (2nd Gen) and Eventarc
HTTP Auth with CORS
HTTP function that supports CORS requests with credentials.
HTTP XML
Parses an HTTP request that contains "application/xml" content.