Skip to content

Commit

Permalink
introspection: add delta pprof endpoints
Browse files Browse the repository at this point in the history
This adds the delta pprof endpoints that pyroscope can make use of.

Signed-off-by: Hank Donnay <hdonnay@redhat.com>
  • Loading branch information
hdonnay committed Jul 6, 2023
1 parent c28648e commit caba76e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ require (
github.com/klauspost/compress v1.16.7
github.com/ldelossa/responserecorder v1.0.2-0.20210711162258-40bec93a9325
github.com/prometheus/client_golang v1.16.0
github.com/pyroscope-io/godeltaprof v0.1.1
github.com/quay/clair/config v1.3.0
github.com/quay/claircore v1.5.8
github.com/quay/zlog v1.1.4
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,8 @@ github.com/prometheus/common v0.42.0 h1:EKsfXEYo4JpWMHH5cg+KOUWeuJSov1Id8zGR8eeI
github.com/prometheus/common v0.42.0/go.mod h1:xBwqVerjNdUDjgODMpudtOMwlOwf2SaTr1yjz4b7Zbc=
github.com/prometheus/procfs v0.10.1 h1:kYK1Va/YMlutzCGazswoHKo//tZVlFpKYh+PymziUAg=
github.com/prometheus/procfs v0.10.1/go.mod h1:nwNm2aOCAYw8uTR/9bWRREkZFxAUcWzPHWJq+XBB/FM=
github.com/pyroscope-io/godeltaprof v0.1.1 h1:+Mmi+b9gR3s/qufuQSxOBjyXZR1fmvS/C12Q73PIPvw=
github.com/pyroscope-io/godeltaprof v0.1.1/go.mod h1:psMITXp90+8pFenXkKIpNhrfmI9saQnPbba27VIaiQE=
github.com/quay/alas v1.0.1 h1:MuFpGGXyZlDD7+F/hrnMZmzhS8P2bjRzX9DyGmyLA+0=
github.com/quay/alas v1.0.1/go.mod h1:pseepSrG9pwry1joG7RO/RNRFJaWqiqx9qeoomeYwEk=
github.com/quay/clair/config v1.3.0 h1:UqJIwvgHaWj6yTWrpVnYnlEIKcVYxJItlEF2EsCnw5s=
Expand Down
4 changes: 4 additions & 0 deletions introspection/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"time"

"github.com/prometheus/client_golang/prometheus/promhttp"
deltapprof "github.com/pyroscope-io/godeltaprof/http/pprof"
"github.com/quay/clair/config"
"github.com/quay/zlog"
"go.opentelemetry.io/otel"
Expand Down Expand Up @@ -216,6 +217,9 @@ func (i *Server) withDiagnostics(_ context.Context) error {
i.HandleFunc("/debug/pprof/profile", pprof.Profile)
i.HandleFunc("/debug/pprof/symbol", pprof.Symbol)
i.HandleFunc("/debug/pprof/trace", pprof.Trace)
i.HandleFunc("/debug/pprof/delta_heap", deltapprof.Heap)
i.HandleFunc("/debug/pprof/delta_block", deltapprof.Block)
i.HandleFunc("/debug/pprof/delta_mutex", deltapprof.Mutex)
return nil
}

Expand Down

0 comments on commit caba76e

Please sign in to comment.