Go App Engine

Stay organized with collections Save and categorize content based on your preferences.

Shows how to initialize cloud.google.com/go/profiler with Go on App Engine.

Explore further

For detailed documentation that includes this code sample, see the following:

Code sample


For more information, see the Profiler Go API reference documentation.

// appengine is an example of starting cloud.google.com/go/profiler on
// App Engine.
package main

import (

func main() {
	// Profiler initialization, best done as early as possible.
	if err := profiler.Start(profiler.Config{
		// Service and ServiceVersion can be automatically inferred when running
		// on App Engine.
		// ProjectID must be set if not running on GCP.
		// ProjectID: "my-project",
	}); err != nil {
		// TODO: Handle error.

What's next

To search and filter code samples for other Google Cloud products, see the Google Cloud sample browser.