Created
February 7, 2022 03:48
-
-
Save ngtuna/658b2934b7a0ab21f0ec7bb344c4a5bc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func main() { | |
tracer.Start( | |
tracer.WithEnv(os.Getenv("DD_ENV")), | |
tracer.WithService(os.Getenv("DD_SERVICE")), | |
tracer.WithServiceVersion(os.Getenv("DD_VERSION")), | |
) | |
defer tracer.Stop() | |
if err := profiler.Start( | |
profiler.WithProfileTypes( | |
profiler.CPUProfile, | |
profiler.HeapProfile, | |
// The profiles below are disabled by | |
// default to keep overhead low, but | |
// can be enabled as needed. | |
// profiler.BlockProfile, | |
// profiler.MutexProfile, | |
// profiler.GoroutineProfile, | |
), | |
); err != nil { | |
log.Fatal(err) | |
} | |
defer profiler.Stop() | |
//my app logic starts here. | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment