2019-10-07 15:55:17 +00:00
|
|
|
---
|
2020-01-18 00:18:09 +00:00
|
|
|
layout: api
|
|
|
|
page_title: /sys/pprof - HTTP API
|
|
|
|
description: The `/sys/pprof` endpoint is used to query profiling information.
|
2019-10-07 15:55:17 +00:00
|
|
|
---
|
|
|
|
|
|
|
|
# `/sys/pprof`
|
|
|
|
|
|
|
|
The `/sys/pprof` endpoint is used to query. The response returned by
|
|
|
|
these endpoints are equivalent to those returned by the `http/pprof`
|
|
|
|
package.
|
|
|
|
|
|
|
|
## Index
|
|
|
|
|
|
|
|
This endpoint returns an HTML page listing the available profiles.
|
|
|
|
|
|
|
|
| Method | Path |
|
2020-01-18 00:18:09 +00:00
|
|
|
| :----- | :------------ |
|
2019-10-07 15:55:17 +00:00
|
|
|
| `GET` | `/sys/pprof/` |
|
|
|
|
|
|
|
|
### Sample Request
|
|
|
|
|
2020-05-21 17:18:17 +00:00
|
|
|
```shell-session
|
2019-10-07 15:55:17 +00:00
|
|
|
$ curl \
|
|
|
|
--header "X-Vault-Token: ..." \
|
|
|
|
http://127.0.0.1:8200/v1/sys/pprof/
|
|
|
|
```
|
|
|
|
|
2021-04-21 19:21:59 +00:00
|
|
|
## Allocs
|
|
|
|
|
|
|
|
This endpoint returns a sampling of historical memory allocations over the life
|
|
|
|
of the program.
|
|
|
|
|
|
|
|
| Method | Path |
|
|
|
|
| :----- | :---------------- |
|
|
|
|
| `GET` | `/sys/pprof/allocs` |
|
|
|
|
|
|
|
|
### Sample Request
|
|
|
|
|
|
|
|
```shell-session
|
|
|
|
$ curl \
|
|
|
|
--header "X-Vault-Token: ..." \
|
|
|
|
http://127.0.0.1:8200/v1/sys/pprof/allocs
|
|
|
|
```
|
|
|
|
|
|
|
|
## Block
|
|
|
|
|
|
|
|
This endpoint returns a sampling of goroutines involved in blocking on
|
|
|
|
synchronization primitives.
|
|
|
|
|
|
|
|
It is included for completeness, but since Vault doesn't normally enable
|
|
|
|
collection of this data, it won't return anything useful with the standard
|
|
|
|
Vault binary.
|
|
|
|
|
|
|
|
| Method | Path |
|
|
|
|
| :----- | :---------------- |
|
|
|
|
| `GET` | `/sys/pprof/block` |
|
|
|
|
|
|
|
|
### Sample Request
|
|
|
|
|
|
|
|
```shell-session
|
|
|
|
$ curl \
|
|
|
|
--header "X-Vault-Token: ..." \
|
|
|
|
http://127.0.0.1:8200/v1/sys/pprof/block
|
|
|
|
```
|
|
|
|
|
2019-10-07 15:55:17 +00:00
|
|
|
## Cmdline
|
|
|
|
|
|
|
|
This endpoint returns the running program's command line, with arguments
|
|
|
|
separated by NUL bytes.
|
|
|
|
|
|
|
|
| Method | Path |
|
2020-01-18 00:18:09 +00:00
|
|
|
| :----- | :------------------- |
|
2019-10-07 15:55:17 +00:00
|
|
|
| `GET` | `/sys/pprof/cmdline` |
|
|
|
|
|
|
|
|
### Sample Request
|
|
|
|
|
2020-05-21 17:18:17 +00:00
|
|
|
```shell-session
|
2019-10-07 15:55:17 +00:00
|
|
|
$ curl \
|
|
|
|
--header "X-Vault-Token: ..." \
|
|
|
|
http://127.0.0.1:8200/v1/sys/pprof/cmdline
|
|
|
|
```
|
|
|
|
|
|
|
|
## Goroutine
|
|
|
|
|
|
|
|
This endpoint returns stack traces of all current goroutines.
|
|
|
|
|
|
|
|
| Method | Path |
|
2020-01-18 00:18:09 +00:00
|
|
|
| :----- | :--------------------- |
|
2019-10-07 15:55:17 +00:00
|
|
|
| `GET` | `/sys/pprof/goroutine` |
|
|
|
|
|
2021-04-21 19:21:59 +00:00
|
|
|
### Parameters
|
|
|
|
|
|
|
|
- `debug` `(int: 0)` - Specifies special arguments for the collection.
|
|
|
|
A value of `2` results in the stack traces being returned as text
|
|
|
|
instead of the default pprof format.
|
|
|
|
|
2019-10-07 15:55:17 +00:00
|
|
|
### Sample Request
|
|
|
|
|
2020-05-21 17:18:17 +00:00
|
|
|
```shell-session
|
2019-10-07 15:55:17 +00:00
|
|
|
$ curl \
|
|
|
|
--header "X-Vault-Token: ..." \
|
|
|
|
http://127.0.0.1:8200/v1/sys/pprof/goroutine
|
|
|
|
```
|
|
|
|
|
|
|
|
## Heap
|
|
|
|
|
|
|
|
This endpoint returns a sampling of memory allocations of live object.
|
|
|
|
|
|
|
|
| Method | Path |
|
2020-01-18 00:18:09 +00:00
|
|
|
| :----- | :---------------- |
|
2019-10-07 15:55:17 +00:00
|
|
|
| `GET` | `/sys/pprof/heap` |
|
|
|
|
|
|
|
|
### Sample Request
|
|
|
|
|
2020-05-21 17:18:17 +00:00
|
|
|
```shell-session
|
2019-10-07 15:55:17 +00:00
|
|
|
$ curl \
|
|
|
|
--header "X-Vault-Token: ..." \
|
|
|
|
http://127.0.0.1:8200/v1/sys/pprof/heap
|
|
|
|
```
|
|
|
|
|
2021-04-21 19:21:59 +00:00
|
|
|
## Mutex
|
|
|
|
|
|
|
|
This endpoint returns a sampling of goroutines holding contended mutexes.
|
|
|
|
|
|
|
|
It is included for completeness, but since Vault doesn't normally enable
|
|
|
|
collection of this data, it won't return anything useful with the standard
|
|
|
|
Vault binary.
|
|
|
|
|
|
|
|
| Method | Path |
|
|
|
|
| :----- | :---------------- |
|
|
|
|
| `GET` | `/sys/pprof/mutex` |
|
|
|
|
|
|
|
|
### Sample Request
|
|
|
|
|
|
|
|
```shell-session
|
|
|
|
$ curl \
|
|
|
|
--header "X-Vault-Token: ..." \
|
|
|
|
http://127.0.0.1:8200/v1/sys/pprof/mutex
|
|
|
|
```
|
|
|
|
|
2019-10-07 15:55:17 +00:00
|
|
|
## Profile
|
|
|
|
|
|
|
|
This endpoint returns a pprof-formatted cpu profile payload. Profiling
|
|
|
|
lasts for duration specified in seconds GET parameter, or for 30 seconds
|
|
|
|
if not specified.
|
|
|
|
|
|
|
|
| Method | Path |
|
2020-01-18 00:18:09 +00:00
|
|
|
| :----- | :------------------- |
|
2019-10-07 15:55:17 +00:00
|
|
|
| `GET` | `/sys/pprof/profile` |
|
|
|
|
|
|
|
|
### Parameters
|
|
|
|
|
2020-01-18 00:18:09 +00:00
|
|
|
- `seconds` `(int: 30)` - Specifies the duration to run the profiling
|
2019-10-07 15:55:17 +00:00
|
|
|
command. This value is specified as a query parameter.
|
|
|
|
|
|
|
|
### Sample Request
|
|
|
|
|
2020-05-21 17:18:17 +00:00
|
|
|
```shell-session
|
2019-10-07 15:55:17 +00:00
|
|
|
$ curl \
|
|
|
|
--header "X-Vault-Token: ..." \
|
|
|
|
http://127.0.0.1:8200/v1/sys/pprof/profile
|
|
|
|
```
|
|
|
|
|
|
|
|
## Symbol
|
|
|
|
|
|
|
|
This endpoint returns the program counters listed in the request.
|
|
|
|
|
|
|
|
| Method | Path |
|
2020-01-18 00:18:09 +00:00
|
|
|
| :----- | :------------------ |
|
2019-10-07 15:55:17 +00:00
|
|
|
| `GET` | `/sys/pprof/symbol` |
|
|
|
|
|
|
|
|
### Sample Request
|
|
|
|
|
2020-05-21 17:18:17 +00:00
|
|
|
```shell-session
|
2019-10-07 15:55:17 +00:00
|
|
|
$ curl \
|
|
|
|
--header "X-Vault-Token: ..." \
|
|
|
|
http://127.0.0.1:8200/v1/sys/pprof/symbol
|
|
|
|
```
|
|
|
|
|
2021-04-21 19:21:59 +00:00
|
|
|
## Threadcreate
|
|
|
|
|
|
|
|
This endpoint returns stack traces of goroutines that led to the creation of
|
|
|
|
new OS threads.
|
|
|
|
|
|
|
|
| Method | Path |
|
|
|
|
| :----- | :--------------------- |
|
|
|
|
| `GET` | `/sys/pprof/threadcreate` |
|
|
|
|
|
|
|
|
### Sample Request
|
|
|
|
|
|
|
|
```shell-session
|
|
|
|
$ curl \
|
|
|
|
--header "X-Vault-Token: ..." \
|
|
|
|
http://127.0.0.1:8200/v1/sys/pprof/threadcreate
|
|
|
|
```
|
|
|
|
|
|
|
|
|
2019-10-07 15:55:17 +00:00
|
|
|
## Trace
|
|
|
|
|
|
|
|
This endpoint returns the execution trace in binary form. Tracing lasts
|
|
|
|
for duration specified in seconds GET parameter, or for 1 second if not
|
|
|
|
specified.
|
|
|
|
|
|
|
|
| Method | Path |
|
2020-01-18 00:18:09 +00:00
|
|
|
| :----- | :----------------- |
|
2019-10-07 15:55:17 +00:00
|
|
|
| `GET` | `/sys/pprof/trace` |
|
|
|
|
|
|
|
|
### Parameters
|
|
|
|
|
2020-01-18 00:18:09 +00:00
|
|
|
- `seconds` `(int: 1)` - Specifies the duration to run the tracing
|
2019-10-07 15:55:17 +00:00
|
|
|
command. This value is specified as a query parameter.
|
2020-01-18 00:18:09 +00:00
|
|
|
|
2019-10-07 15:55:17 +00:00
|
|
|
### Sample Request
|
|
|
|
|
2020-05-21 17:18:17 +00:00
|
|
|
```shell-session
|
2019-10-07 15:55:17 +00:00
|
|
|
$ curl \
|
|
|
|
--header "X-Vault-Token: ..." \
|
|
|
|
http://127.0.0.1:8200/v1/sys/pprof/trace
|
2020-01-18 00:18:09 +00:00
|
|
|
```
|