-
Notifications
You must be signed in to change notification settings - Fork 634
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Hidde Beydals <[email protected]>
- Loading branch information
Showing
1 changed file
with
35 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Advanced debugging | ||
|
||
This guide covers more advanced debugging topics such as collecting | ||
runtime profiling data from GitOps Toolkit components. | ||
|
||
As a user, this page normally should be a last resort, but you may | ||
be asked by a maintainer to share a [collected profile](#collecting-a-profile) | ||
to debug e.g. performance issues. | ||
|
||
## Pprof | ||
|
||
The [GitOps Toolkit components](../components/index.md) serve [`pprof`](https://golang.org/pkg/net/http/pprof/) | ||
runtime profiling data on their metrics HTTP server (default `:8080`). | ||
|
||
### Endpoints | ||
|
||
| | Path | | ||
|-------------|------------------------| | ||
| Index | `/debug/pprof/` | | ||
| CPU profile | `/debug/pprof/profile` | | ||
| Symbol | `/debug/pprof/symbol` | | ||
| Trace | `/debug/pprof/trace` | | ||
|
||
### Collecting a profile | ||
|
||
To collect a profile, port-forward to the component's metrics endpoint and | ||
collect the data from the [endpoint](#endpoints) of choice: | ||
|
||
```console | ||
$ kubectl port-forward -n <namespace> deploy/<component> 8080 | ||
$ curl -Sk -v http://localhost:8080/debug/pprof/heap > heap.out | ||
``` | ||
|
||
The collected profile [can be analyzed using `go`](https://blog.golang.org/pprof), | ||
or shared with one of the maintainers. |