From 6fac0e566b5909ee0e56831ba79b7f8557bffff8 Mon Sep 17 00:00:00 2001 From: Eitan Yarmush Date: Fri, 3 May 2024 19:08:15 +0000 Subject: [PATCH 1/3] deltaprof backport --- changelog/v0.38.3/add-godeltapprof.yaml | 5 +++++ ci/oss_compliance/osa_provided.md | 2 ++ go.mod | 4 +++- go.sum | 4 ++++ pkg/stats/pprof.go | 5 +++++ 5 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 changelog/v0.38.3/add-godeltapprof.yaml diff --git a/changelog/v0.38.3/add-godeltapprof.yaml b/changelog/v0.38.3/add-godeltapprof.yaml new file mode 100644 index 000000000..43535e40b --- /dev/null +++ b/changelog/v0.38.3/add-godeltapprof.yaml @@ -0,0 +1,5 @@ +changelog: + - type: NON_USER_FACING + description: > + "adds godeltapprof to the debug endpoints, to be used with pyroscope or grafana cloud profiler" + skipCI: "false" diff --git a/ci/oss_compliance/osa_provided.md b/ci/oss_compliance/osa_provided.md index 5e6bb0cea..90ffe7d92 100644 --- a/ci/oss_compliance/osa_provided.md +++ b/ci/oss_compliance/osa_provided.md @@ -17,8 +17,10 @@ Name|Version|License [cmp/internal](https://github.com/google/go-cmp)|v0.5.9|BSD 3-clause "New" or "Revised" License [gofuzz/bytesource](https://github.com/google/gofuzz)|v1.2.0|Apache License 2.0 [google/uuid](https://github.com/google/uuid)|v1.3.0|BSD 3-clause "New" or "Revised" License +[pyroscope-go/godeltaprof](https://github.com/grafana/pyroscope-go)|v0.1.6|Apache License 2.0 [josharian/intern](https://github.com/josharian/intern)|v1.0.0|MIT License [json-iterator/go](https://github.com/json-iterator/go)|v1.1.12|MIT License +[klauspost/compress](https://github.com/klauspost/compress)|v1.17.3|Apache License 2.0 [mailru/easyjson](https://github.com/mailru/easyjson)|v0.7.7|MIT License [golang_protobuf_extensions/pbutil](https://github.com/matttproud/golang_protobuf_extensions)|v1.0.4|Apache License 2.0 [modern-go/concurrent](https://github.com/modern-go/concurrent)|v0.0.0-20180306012644-bacd9c7ef1dd|Apache License 2.0 diff --git a/go.mod b/go.mod index 124527606..62518af0a 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,8 @@ require ( github.com/golang/mock v1.6.0 github.com/golang/protobuf v1.5.3 github.com/google/gnostic-models v0.6.8 - github.com/google/go-cmp v0.5.9 + github.com/google/go-cmp v0.6.0 + github.com/grafana/pyroscope-go/godeltaprof v0.1.6 github.com/hashicorp/go-multierror v1.1.0 github.com/iancoleman/orderedmap v0.0.0-20190318233801-ac98e3ecb4b0 github.com/iancoleman/strcase v0.2.0 @@ -93,6 +94,7 @@ require ( github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/k0kubun/pp v2.3.0+incompatible // indirect + github.com/klauspost/compress v1.17.3 // indirect github.com/lyft/protoc-gen-star v0.6.1 // indirect github.com/mailru/easyjson v0.7.7 // indirect github.com/mattn/go-colorable v0.1.7 // indirect diff --git a/go.sum b/go.sum index c084d924a..031bce935 100644 --- a/go.sum +++ b/go.sum @@ -464,6 +464,8 @@ github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gosuri/uitable v0.0.4/go.mod h1:tKR86bXuXPZazfOTG1FIzvjIdXzd0mo4Vtn16vt0PJo= +github.com/grafana/pyroscope-go/godeltaprof v0.1.6 h1:nEdZ8louGAplSvIJi1HVp7kWvFvdiiYg3COLlTwJiFo= +github.com/grafana/pyroscope-go/godeltaprof v0.1.6/go.mod h1:Tk376Nbldo4Cha9RgiU7ik8WKFkNpfds98aUzS8omLE= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= @@ -557,6 +559,8 @@ github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvW github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/klauspost/compress v1.17.3 h1:qkRjuerhUU1EmXLYGkSH6EZL+vPSxIrYjLNAK4slzwA= +github.com/klauspost/compress v1.17.3/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= diff --git a/pkg/stats/pprof.go b/pkg/stats/pprof.go index 884859e76..4b2dc6d56 100644 --- a/pkg/stats/pprof.go +++ b/pkg/stats/pprof.go @@ -3,6 +3,8 @@ package stats import ( "net/http" "net/http/pprof" + + deltapprof "github.com/grafana/pyroscope-go/godeltaprof/http/pprof" ) func AddPprof(mux *http.ServeMux) { @@ -11,6 +13,9 @@ func AddPprof(mux *http.ServeMux) { mux.HandleFunc("/debug/pprof/profile", pprof.Profile) mux.HandleFunc("/debug/pprof/symbol", pprof.Symbol) mux.HandleFunc("/debug/pprof/trace", pprof.Trace) + mux.HandleFunc("/debug/pprof/delta_heap", deltapprof.Heap) + mux.HandleFunc("/debug/pprof/delta_threadcreate", deltapprof.Mutex) + mux.HandleFunc("/debug/pprof/delta_block", deltapprof.Block) profileDescriptions["/debug/pprof/"] = `PProf related things:
full goroutine stack dump From 68b45538e30ceaaf6234a1356918277fe6b72a68 Mon Sep 17 00:00:00 2001 From: Eitan Yarmush Date: Fri, 3 May 2024 19:13:07 +0000 Subject: [PATCH 2/3] codegen --- changelog/v0.36.7/deltaprof.yaml | 5 +++++ ci/oss_compliance/osa_provided.md | 2 +- go.sum | 4 ++-- 3 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 changelog/v0.36.7/deltaprof.yaml diff --git a/changelog/v0.36.7/deltaprof.yaml b/changelog/v0.36.7/deltaprof.yaml new file mode 100644 index 000000000..052269eb8 --- /dev/null +++ b/changelog/v0.36.7/deltaprof.yaml @@ -0,0 +1,5 @@ +changelog: + - type: NON_USER_FACING + description: > + "adds godeltapprof to the debug endpoints, to be used with pyroscope or grafana cloud profiler" + skipCI: "false" \ No newline at end of file diff --git a/ci/oss_compliance/osa_provided.md b/ci/oss_compliance/osa_provided.md index 90ffe7d92..cedcc228b 100644 --- a/ci/oss_compliance/osa_provided.md +++ b/ci/oss_compliance/osa_provided.md @@ -14,7 +14,7 @@ Name|Version|License [groupcache/lru](https://github.com/golang/groupcache)|v0.0.0-20210331224755-41bb18bfe9da|Apache License 2.0 [golang/protobuf](https://github.com/golang/protobuf)|v1.5.3|BSD 3-clause "New" or "Revised" License [google/gnostic-models](https://github.com/google/gnostic-models)|v0.6.8|Apache License 2.0 -[cmp/internal](https://github.com/google/go-cmp)|v0.5.9|BSD 3-clause "New" or "Revised" License +[cmp/internal](https://github.com/google/go-cmp)|v0.6.0|BSD 3-clause "New" or "Revised" License [gofuzz/bytesource](https://github.com/google/gofuzz)|v1.2.0|Apache License 2.0 [google/uuid](https://github.com/google/uuid)|v1.3.0|BSD 3-clause "New" or "Revised" License [pyroscope-go/godeltaprof](https://github.com/grafana/pyroscope-go)|v0.1.6|Apache License 2.0 diff --git a/go.sum b/go.sum index 031bce935..ce68947ba 100644 --- a/go.sum +++ b/go.sum @@ -415,8 +415,8 @@ github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= -github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-github/v29 v29.0.2/go.mod h1:CHKiKKPHJ0REzfwc14QMklvtHwCveD0PxlMjLlzAM5E= github.com/google/go-github/v29 v29.0.3/go.mod h1:CHKiKKPHJ0REzfwc14QMklvtHwCveD0PxlMjLlzAM5E= github.com/google/go-github/v32 v32.0.0/go.mod h1:rIEpZD9CTDQwDK9GDrtMTycQNA4JU3qBsCizh3q2WCI= From 352a164c70e34068b678ef117fd89fb058e2c95b Mon Sep 17 00:00:00 2001 From: Eitan Yarmush Date: Fri, 3 May 2024 19:15:28 +0000 Subject: [PATCH 3/3] oops --- changelog/v0.38.3/add-godeltapprof.yaml | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 changelog/v0.38.3/add-godeltapprof.yaml diff --git a/changelog/v0.38.3/add-godeltapprof.yaml b/changelog/v0.38.3/add-godeltapprof.yaml deleted file mode 100644 index 43535e40b..000000000 --- a/changelog/v0.38.3/add-godeltapprof.yaml +++ /dev/null @@ -1,5 +0,0 @@ -changelog: - - type: NON_USER_FACING - description: > - "adds godeltapprof to the debug endpoints, to be used with pyroscope or grafana cloud profiler" - skipCI: "false"