Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cherry-pick] feat(cmd/debuginfo) add new metrics to be collected #7562

Merged
merged 1 commit into from
Mar 12, 2021

Conversation

OmarAyo
Copy link
Contributor

@OmarAyo OmarAyo commented Mar 12, 2021

  • This PR adds 5 new metrics (/jemalloc, /state, /health, /debug/vars, /metrics) to be collected when running the debuginfo
  • the flag -p has been changed to -m to reflect the change. This new flag will let you pick up one or multiple metrics/pprof to be collected:
-m, --metrics strings    List of metrics & profile to dump in the report. (default [jemalloc,state,health,vars,metrics,heap,cpu_profile,trace,goroutine,threadcreate,block,mutex])
  • default value of -s flag is now 30sec since it requires 30s to collect a cpu profile
  • when saving the metric/profile - it will log the metric/profile name and the path where it's saving to.
  • added new flag for time based profiles that are cpu and trace profiles:
-c, --cron_pprof strings   time-based pprof (default [cpu_profile,trace])

output of running the debuginfo command:

 dgraph debuginfo -s 30
I0305 21:01:44.730085   10587 run.go:126] using directory /tmp/dgraph-debuginfo041885197 for debug info dump.
I0305 21:01:44.730251   10587 debugging.go:74] fetching information over HTTP from http://localhost:8080/jemalloc
I0305 21:01:44.730261   10587 debugging.go:76] please wait... (30s)
I0305 21:01:44.731077   10587 debugging.go:51] saving jemalloc metric in /tmp/dgraph-debuginfo041885197/alpha_jemalloc.gz
I0305 21:01:44.731086   10587 debugging.go:74] fetching information over HTTP from http://localhost:8080/state
I0305 21:01:44.731092   10587 debugging.go:76] please wait... (30s)
I0305 21:01:44.731720   10587 debugging.go:51] saving state metric in /tmp/dgraph-debuginfo041885197/alpha_state.gz
I0305 21:01:44.731731   10587 debugging.go:74] fetching information over HTTP from http://localhost:8080/health
I0305 21:01:44.731736   10587 debugging.go:76] please wait... (30s)
I0305 21:01:44.732048   10587 debugging.go:51] saving health metric in /tmp/dgraph-debuginfo041885197/alpha_health.gz
I0305 21:01:44.732058   10587 debugging.go:74] fetching information over HTTP from http://localhost:8080/debug/vars
I0305 21:01:44.732065   10587 debugging.go:76] please wait... (30s)
I0305 21:01:44.732557   10587 debugging.go:51] saving vars metric in /tmp/dgraph-debuginfo041885197/alpha_vars.gz
I0305 21:01:44.732568   10587 debugging.go:74] fetching information over HTTP from http://localhost:8080/metrics
I0305 21:01:44.732573   10587 debugging.go:76] please wait... (30s)
I0305 21:01:44.734904   10587 debugging.go:51] saving metrics metric in /tmp/dgraph-debuginfo041885197/alpha_metrics.gz
I0305 21:01:44.734912   10587 debugging.go:74] fetching information over HTTP from http://localhost:8080/debug/pprof/heap
I0305 21:01:44.734917   10587 debugging.go:76] please wait... (30s)
I0305 21:01:44.738036   10587 debugging.go:51] saving heap metric in /tmp/dgraph-debuginfo041885197/alpha_heap.gz
I0305 21:01:44.738048   10587 debugging.go:74] fetching information over HTTP from http://localhost:8080/debug/pprof/goroutine?debug=2
I0305 21:01:44.738057   10587 debugging.go:76] please wait... (30s)
I0305 21:01:44.739136   10587 debugging.go:51] saving goroutine metric in /tmp/dgraph-debuginfo041885197/alpha_goroutine.gz
I0305 21:01:44.739145   10587 debugging.go:74] fetching information over HTTP from http://localhost:8080/debug/pprof/threadcreate
I0305 21:01:44.739151   10587 debugging.go:76] please wait... (30s)
I0305 21:01:44.740182   10587 debugging.go:51] saving threadcreate metric in /tmp/dgraph-debuginfo041885197/alpha_threadcreate.gz
I0305 21:01:44.740192   10587 debugging.go:74] fetching information over HTTP from http://localhost:8080/debug/pprof/block
I0305 21:01:44.740198   10587 debugging.go:76] please wait... (30s)
I0305 21:01:44.741154   10587 debugging.go:51] saving block metric in /tmp/dgraph-debuginfo041885197/alpha_block.gz
I0305 21:01:44.741163   10587 debugging.go:74] fetching information over HTTP from http://localhost:8080/debug/pprof/mutex
I0305 21:01:44.741169   10587 debugging.go:76] please wait... (30s)
I0305 21:01:44.742330   10587 debugging.go:51] saving mutex metric in /tmp/dgraph-debuginfo041885197/alpha_mutex.gz
I0305 21:01:44.742341   10587 debugging.go:74] fetching information over HTTP from http://localhost:8080/debug/pprof/profile?seconds=30s
I0305 21:01:44.742348   10587 debugging.go:76] please wait... (30s)
I0305 21:02:14.812492   10587 debugging.go:63] saving cpu_profile metric in /tmp/dgraph-debuginfo041885197/alpha_cpu_profile.gz
I0305 21:02:14.812570   10587 debugging.go:74] fetching information over HTTP from http://localhost:8080/debug/pprof/trace?seconds=30s
I0305 21:02:14.812596   10587 debugging.go:76] please wait... (30s)
I0305 21:02:15.816449   10587 debugging.go:63] saving trace metric in /tmp/dgraph-debuginfo041885197/alpha_trace.gz
I0305 21:02:15.842375   10587 run.go:159] Debuginfo archive successful: dgraph-debuginfo041885197.tar.gz

(cherry picked from commit 79ada0e)


This change is Reviewable

- This PR adds 5 new metrics (/jemalloc, /state, /health, /debug/vars, /metrics) to be collected when running  the `debuginfo` 
- the flag `-p` has been changed to `-m` to reflect the change. This new flag will let you pick up one or multiple metrics/pprof to be collected:
```
-m, --metrics strings    List of metrics & profile to dump in the report. (default [jemalloc,state,health,vars,metrics,heap,cpu_profile,trace,goroutine,threadcreate,block,mutex])
```
- default value of `-s` flag is now 30sec since it requires 30s to collect a cpu profile
- when saving the metric/profile - it will log the metric/profile name and the path where it's saving to.
- added new flag for time based profiles that are cpu and trace profiles:
```
-c, --cron_pprof strings   time-based pprof (default [cpu_profile,trace])
```

output of running the `debuginfo` command:
```
 dgraph debuginfo -s 30
I0305 21:01:44.730085   10587 run.go:126] using directory /tmp/dgraph-debuginfo041885197 for debug info dump.
I0305 21:01:44.730251   10587 debugging.go:74] fetching information over HTTP from http://localhost:8080/jemalloc
I0305 21:01:44.730261   10587 debugging.go:76] please wait... (30s)
I0305 21:01:44.731077   10587 debugging.go:51] saving jemalloc metric in /tmp/dgraph-debuginfo041885197/alpha_jemalloc.gz
I0305 21:01:44.731086   10587 debugging.go:74] fetching information over HTTP from http://localhost:8080/state
I0305 21:01:44.731092   10587 debugging.go:76] please wait... (30s)
I0305 21:01:44.731720   10587 debugging.go:51] saving state metric in /tmp/dgraph-debuginfo041885197/alpha_state.gz
I0305 21:01:44.731731   10587 debugging.go:74] fetching information over HTTP from http://localhost:8080/health
I0305 21:01:44.731736   10587 debugging.go:76] please wait... (30s)
I0305 21:01:44.732048   10587 debugging.go:51] saving health metric in /tmp/dgraph-debuginfo041885197/alpha_health.gz
I0305 21:01:44.732058   10587 debugging.go:74] fetching information over HTTP from http://localhost:8080/debug/vars
I0305 21:01:44.732065   10587 debugging.go:76] please wait... (30s)
I0305 21:01:44.732557   10587 debugging.go:51] saving vars metric in /tmp/dgraph-debuginfo041885197/alpha_vars.gz
I0305 21:01:44.732568   10587 debugging.go:74] fetching information over HTTP from http://localhost:8080/metrics
I0305 21:01:44.732573   10587 debugging.go:76] please wait... (30s)
I0305 21:01:44.734904   10587 debugging.go:51] saving metrics metric in /tmp/dgraph-debuginfo041885197/alpha_metrics.gz
I0305 21:01:44.734912   10587 debugging.go:74] fetching information over HTTP from http://localhost:8080/debug/pprof/heap
I0305 21:01:44.734917   10587 debugging.go:76] please wait... (30s)
I0305 21:01:44.738036   10587 debugging.go:51] saving heap metric in /tmp/dgraph-debuginfo041885197/alpha_heap.gz
I0305 21:01:44.738048   10587 debugging.go:74] fetching information over HTTP from http://localhost:8080/debug/pprof/goroutine?debug=2
I0305 21:01:44.738057   10587 debugging.go:76] please wait... (30s)
I0305 21:01:44.739136   10587 debugging.go:51] saving goroutine metric in /tmp/dgraph-debuginfo041885197/alpha_goroutine.gz
I0305 21:01:44.739145   10587 debugging.go:74] fetching information over HTTP from http://localhost:8080/debug/pprof/threadcreate
I0305 21:01:44.739151   10587 debugging.go:76] please wait... (30s)
I0305 21:01:44.740182   10587 debugging.go:51] saving threadcreate metric in /tmp/dgraph-debuginfo041885197/alpha_threadcreate.gz
I0305 21:01:44.740192   10587 debugging.go:74] fetching information over HTTP from http://localhost:8080/debug/pprof/block
I0305 21:01:44.740198   10587 debugging.go:76] please wait... (30s)
I0305 21:01:44.741154   10587 debugging.go:51] saving block metric in /tmp/dgraph-debuginfo041885197/alpha_block.gz
I0305 21:01:44.741163   10587 debugging.go:74] fetching information over HTTP from http://localhost:8080/debug/pprof/mutex
I0305 21:01:44.741169   10587 debugging.go:76] please wait... (30s)
I0305 21:01:44.742330   10587 debugging.go:51] saving mutex metric in /tmp/dgraph-debuginfo041885197/alpha_mutex.gz
I0305 21:01:44.742341   10587 debugging.go:74] fetching information over HTTP from http://localhost:8080/debug/pprof/profile?seconds=30s
I0305 21:01:44.742348   10587 debugging.go:76] please wait... (30s)
I0305 21:02:14.812492   10587 debugging.go:63] saving cpu_profile metric in /tmp/dgraph-debuginfo041885197/alpha_cpu_profile.gz
I0305 21:02:14.812570   10587 debugging.go:74] fetching information over HTTP from http://localhost:8080/debug/pprof/trace?seconds=30s
I0305 21:02:14.812596   10587 debugging.go:76] please wait... (30s)
I0305 21:02:15.816449   10587 debugging.go:63] saving trace metric in /tmp/dgraph-debuginfo041885197/alpha_trace.gz
I0305 21:02:15.842375   10587 run.go:159] Debuginfo archive successful: dgraph-debuginfo041885197.tar.gz

```

(cherry picked from commit 79ada0e)
@OmarAyo OmarAyo changed the title feat(cmd/debuginfo) add new metrics to be collected (#7439) feat(cmd/debuginfo) add new metrics to be collected Mar 12, 2021
@OmarAyo OmarAyo changed the title feat(cmd/debuginfo) add new metrics to be collected [cherry-pick] feat(cmd/debuginfo) add new metrics to be collected Mar 12, 2021
Copy link
Contributor

@danielmai danielmai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 2 of 2 files at r1.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @manishrjain and @vvbalaji-dgraph)

@OmarAyo OmarAyo merged commit 12ae8f7 into release/v20.11 Mar 12, 2021
@OmarAyo OmarAyo deleted the omar/cherry-pick-debuginfo-improvments branch March 12, 2021 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants