All Projects → Raffo → go-pprof-trace-example

Raffo / go-pprof-trace-example

Licence: other
This repo contains an example on how to use the Go trace and profile tool

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to go-pprof-trace-example

gpu-pathtracer
physically based path tracer on gpu
Stars: ✭ 44 (+41.94%)
Mutual labels:  tracing
datadog-trace-agent
Datadog Trace Agent archive (pre-6.10.0)
Stars: ✭ 70 (+125.81%)
Mutual labels:  tracing
barectf
Generator of ANSI C tracers which output CTF data streams
Stars: ✭ 50 (+61.29%)
Mutual labels:  tracing
perforator
Record "perf" performance metrics for individual functions/regions of an ELF binary.
Stars: ✭ 33 (+6.45%)
Mutual labels:  tracing
javaagent
Hypertrace OpenTelemetry Java agent with payload/body and headers data capture.
Stars: ✭ 13 (-58.06%)
Mutual labels:  tracing
nest-xray
Distributed tracing for Nestjs with AWS X-Ray as the backend. Instrument incoming and outgoing HTTP requests
Stars: ✭ 50 (+61.29%)
Mutual labels:  tracing
juice
Java后端开发库,涵盖:常用工具类、SPI扩展、分布式锁、限流、分布式链路追踪等。
Stars: ✭ 32 (+3.23%)
Mutual labels:  tracing
grpc-apm-spring-boot-starter
Spring boot starter for gRPC framework with Elastic APM
Stars: ✭ 18 (-41.94%)
Mutual labels:  tracing
ferrisetw
Basically a KrabsETW rip-off written in Rust
Stars: ✭ 22 (-29.03%)
Mutual labels:  tracing
ipftrace
[Deplicated] Now we have more sophisticated (and compact) implementation in ipftrace2 repository. Please check it as well.
Stars: ✭ 60 (+93.55%)
Mutual labels:  tracing
go-distsys
Distributed Systems programming examples in the Go programming language.
Stars: ✭ 101 (+225.81%)
Mutual labels:  tracing
uptrace
Open source APM: OpenTelemetry traces, metrics, and logs
Stars: ✭ 1,187 (+3729.03%)
Mutual labels:  tracing
jaeger-node
Out of the box distributed tracing for Node.js applications.
Stars: ✭ 66 (+112.9%)
Mutual labels:  tracing
Postmortem
A simple debug library for Clojure(Script) that features data-oriented logging and tracing
Stars: ✭ 143 (+361.29%)
Mutual labels:  tracing
kong-plugin-zipkin
A Kong plugin for propogating zipkin spans and reporting spans to a zipkin server - this plugin has been moved into https://github.com/Kong/kong, please open issues and PRs in that repo
Stars: ✭ 60 (+93.55%)
Mutual labels:  tracing
thundra-agent-python
Thundra Lambda Python Agent
Stars: ✭ 36 (+16.13%)
Mutual labels:  tracing
serverless-lumigo-plugin
Serverless monitoring and troubleshooting plugin to easily apply distributed tracing
Stars: ✭ 59 (+90.32%)
Mutual labels:  tracing
opentelemetry-js-api
OpenTelemetry Javascript API
Stars: ✭ 75 (+141.94%)
Mutual labels:  tracing
opencensus elixir
No description or website provided.
Stars: ✭ 38 (+22.58%)
Mutual labels:  tracing
java-jaxrs
OpenTracing Java JAX-RS instrumentation
Stars: ✭ 37 (+19.35%)
Mutual labels:  tracing

Go pprof & trace example

This repo contains just an example on how to use the Go trace and pprof tools. It aims at being short, simple, with clear commands and a short piece of code. It also contains some links to some more details articles.

Profiling

Profiling based on CPU:

go tool pprof http://127.0.0.1:8080/debug/pprof/profile

Profiling based on heap:

go tool pprof http://127.0.0.1:8080/debug/pprof/heap

NOTE: use the -seconds option to limit the time of tracing. Take into account that if you use read or write timeout for your application, this will also limit your capabilities of getting the profiling data.

Interesting option for memory profiling:

Sample value selection option (for heap profiles):
  -inuse_space      Display in-use memory size
  -inuse_objects    Display in-use object counts
  -alloc_space      Display allocated memory size
  -alloc_objects    Display allocated object counts

When launched an interactive mode, use top to see the top entries and web to get a nice graph in your browser. For more information, a more in detail article:

http://artem.krylysov.com/blog/2017/03/13/profiling-and-optimizing-go-web-applications/

Tracing

Get the tracing data:

curl http://localhost:8080/debug/pprof/trace?seconds=5 > trace.out

Start the tracing interface:

go tool trace -http=':8081' trace http://localhost:8080/debug/pprof/trace

NOTE: the -http option specifies the address to use for the Web API for the tracing tool. For more information on the tool, read this interesting article: https://making.pusher.com/go-tool-trace/

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].