mirror of
https://github.com/golang/go.git
synced 2025-05-05 15:43:04 +00:00
Updated Diagnostics (markdown)
parent
953e95a070
commit
7b3a30e2bf
@ -70,6 +70,16 @@ Additionally to what is provided by the runtime, Go users can create their custo
|
||||
|
||||
Go will soon allow users to attach [context-scoped labels](https://github.com/golang/proposal/blob/master/design/17280-profile-labels.md) to pprof records. Once profiler labels are available, it will be possible to attach user IDs, request URLs, RPC names, etc. to profiling data which later may be examined by labels.
|
||||
|
||||
|
||||
**Can I serve the profiler handlers (/debug/proof/…) on a different path and port?**
|
||||
Yes! net/http/pprof package registers its handlers to the default mux by default. But, you can also register them yourself by using the handlers exported from the package.
|
||||
For example, the following example will serve the pprof.Profile handler on :7777 at /pprof/profile:
|
||||
|
||||
```
|
||||
mux := http.NewServeMux()
|
||||
mux.HandleFunc("/pprof/profile", pprof.Profile)
|
||||
http.ListenAndServe(":7777", mux)
|
||||
```
|
||||
---
|
||||
|
||||
To be continued with tracing, runtime stats, debugging and concurrency sections.
|
Loading…
x
Reference in New Issue
Block a user