feat(pprof): Enable pprof endpoints behind flag (#6644)
This commit is contained in:
1 parent
bf24d6607f
commit
bb806026b3
8 files changed
+67
-78
No files matched your search
+5
-5
@@ -1,19 +1,19 @@
|
||||
# Tracing in Boundary
|
||||
|
||||
Boundary includes a small number of runtime tracing user regions, which can be used to see where Boundary spends its time during execution.
|
||||
To create a trace, we first need to expose the pprof endpoint. It is disabled by default. Exposing the pprof endpoint is as simple as building with the `pprof` build tag or running
|
||||
To create a trace, we first need to expose the pprof endpoint. It is disabled by default. Exposing the pprof endpoint requires enabling the runtime `-debug` flag on a process with an `ops` listener.
|
||||
|
||||
```
|
||||
make build-pprof
|
||||
make build
|
||||
boundary dev -debug -ops-listen-address=127.0.0.1:9203
|
||||
```
|
||||
|
||||
This will create a new HTTP endpoint on `localhost:6060` of the running binary. As such, it's only accessible to the users on the same machine.
|
||||
Remember to remove this code again once you're done testing.
|
||||
This will expose the pprof endpoints on the configured ops listener. With the example above, that means `127.0.0.1:9203`, so it's only accessible to users on the same machine.
|
||||
|
||||
To create a trace, one can use any tool that allows creating HTTP requests, e.g. `curl`. To create a 3 second trace:
|
||||
|
||||
```
|
||||
$ curl -o trace.out http://localhost:6060/debug/pprof/trace?seconds=3
|
||||
$ curl -o trace.out http://127.0.0.1:9203/debug/pprof/trace?seconds=3
|
||||
```
|
||||
|
||||
Traces are most interesting if they contain some request handling, so it is recommended to prepare some HTTP requests that trigger the behavior you want to understand that you can run while the trace is being collected.
|
||||
|
||||
Reference in new issue
Block a user