profiling: Support binding pprof server to custom network interfaces (#36580) (#38009)

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
(cherry picked from commit 0819d15942)

Co-authored-by: Victor Cinaglia <victor@grafana.com>
This commit is contained in:
Grot (@grafanabot)
2021-08-18 19:48:46 +02:00
committed by GitHub
co-authored by Victor Cinaglia
parent 0194e87bf7
commit c4ffd13612
4 changed files with 28 additions and 13 deletions
+5 -4
View File
@@ -10,11 +10,11 @@ when investigating certain performance problems. It's _not_ recommended to have
## Turn on profiling
The `grafana-server` can be started with the arguments `-profile` to enable profiling and `-profile-port` to override
the default HTTP port (`6060`) where the `pprof` debugging endpoints are available, for example:
You can start the `grafana-server` with the following arguments: `-profile` to enable profiling, `-profile-addr` to override the default HTTP address (`localhost`), and
`-profile-port` to override the default HTTP port (`6060`) where the `pprof` debugging endpoints are available. For example:
```bash
./grafana-server -profile -profile-port=8080
./grafana-server -profile -profile-addr=0.0.0.0 -profile-port=8080
```
Note that `pprof` debugging endpoints are served on a different port than the Grafana HTTP server.
@@ -23,6 +23,7 @@ You can configure or override profiling settings using environment variables:
```bash
export GF_DIAGNOSTICS_PROFILING_ENABLED=true
export GF_DIAGNOSTICS_PROFILING_ADDR=0.0.0.0
export GF_DIAGNOSTICS_PROFILING_PORT=8080
```
@@ -52,4 +53,4 @@ go tool trace <trace file>
2019/11/24 22:20:42 Opening browser. Trace viewer is listening on http://127.0.0.1:39735
```
See [Go command trace](https://golang.org/cmd/trace/) for more information about how to analyze trace files.
For more information about how to analyze trace files, refer to [Go command trace](https://golang.org/cmd/trace/).