fix: removed pyroscope/pprof PoC for now
Signed-off-by: William Artero <git@artero.dev>
This commit is contained in:
parent
a969b234fd
commit
dfd0378e94
|
@ -38,14 +38,14 @@ repos:
|
|||
- repo: https://github.com/tekwizely/pre-commit-golang
|
||||
rev: v1.0.0-beta.5
|
||||
hooks:
|
||||
- id: golangci-lint-repo-mod
|
||||
name: golangci-lint
|
||||
- id: go-mod-tidy
|
||||
name: go mod tidy
|
||||
- id: go-build-repo-mod
|
||||
name: go build
|
||||
- id: go-test-repo-mod
|
||||
name: go test
|
||||
- id: golangci-lint-repo-mod
|
||||
name: golangci-lint
|
||||
##
|
||||
## Invoking Custom Go Tools
|
||||
## - Configured *entirely* through the `args` attribute, ie:
|
||||
|
|
3
go.mod
3
go.mod
|
@ -3,13 +3,13 @@ module github.com/wwmoraes/anilistarr
|
|||
go 1.19
|
||||
|
||||
require (
|
||||
dario.cat/mergo v1.0.0
|
||||
github.com/Khan/genqlient v0.6.0
|
||||
github.com/MrAlias/otlpr v0.2.0
|
||||
github.com/XSAM/otelsql v0.23.0
|
||||
github.com/dgraph-io/badger/v4 v4.2.0
|
||||
github.com/go-chi/chi/v5 v5.0.10
|
||||
github.com/go-logr/logr v1.2.4
|
||||
github.com/pyroscope-io/client v0.7.1
|
||||
github.com/redis/go-redis/extra/redisotel/v9 v9.0.5
|
||||
github.com/redis/go-redis/v9 v9.0.5
|
||||
github.com/riandyrn/otelchi v0.5.1
|
||||
|
@ -50,7 +50,6 @@ require (
|
|||
github.com/klauspost/compress v1.12.3 // indirect
|
||||
github.com/mattn/go-isatty v0.0.19 // indirect
|
||||
github.com/pkg/errors v0.9.1 // indirect
|
||||
github.com/pyroscope-io/godeltaprof v0.1.0 // indirect
|
||||
github.com/redis/go-redis/extra/rediscmd/v9 v9.0.5 // indirect
|
||||
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
|
||||
github.com/vektah/gqlparser/v2 v2.5.1 // indirect
|
||||
|
|
7
go.sum
7
go.sum
|
@ -30,6 +30,8 @@ cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0Zeo
|
|||
cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk=
|
||||
cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs=
|
||||
cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
|
||||
dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk=
|
||||
dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk=
|
||||
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
|
||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
|
||||
|
@ -198,10 +200,6 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
|
|||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/prashantv/gostub v1.1.0 h1:BTyx3RfQjRHnUWaGF9oQos79AlQ5k8WNktv7VGvVH4g=
|
||||
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
|
||||
github.com/pyroscope-io/client v0.7.1 h1:yFRhj3vbgjBxehvxQmedmUWJQ4CAfCHhn+itPsuWsHw=
|
||||
github.com/pyroscope-io/client v0.7.1/go.mod h1:4h21iOU4pUOq0prKyDlvYRL+SCKsBc5wKiEtV+rJGqU=
|
||||
github.com/pyroscope-io/godeltaprof v0.1.0 h1:UBqtjt0yZi4jTxqZmLAs34XG6ycS3vUTlhEUSq4NHLE=
|
||||
github.com/pyroscope-io/godeltaprof v0.1.0/go.mod h1:psMITXp90+8pFenXkKIpNhrfmI9saQnPbba27VIaiQE=
|
||||
github.com/redis/go-redis/extra/rediscmd/v9 v9.0.5 h1:EaDatTxkdHG+U3Bk4EUr+DZ7fOGwTfezUiUJMaIcaho=
|
||||
github.com/redis/go-redis/extra/rediscmd/v9 v9.0.5/go.mod h1:fyalQWdtzDBECAQFBJuQe5bzQ02jGd5Qcbgb97Flm7U=
|
||||
github.com/redis/go-redis/extra/redisotel/v9 v9.0.5 h1:EfpWLLCyXw8PSM2/XNJLjI3Pb27yVE+gIAfeqp8LUCc=
|
||||
|
@ -554,6 +552,7 @@ gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
|||
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
|
|
|
@ -6,13 +6,11 @@ import (
|
|||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
"runtime"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/MrAlias/otlpr"
|
||||
"github.com/go-logr/logr"
|
||||
"github.com/pyroscope-io/client/pyroscope"
|
||||
otelruntime "go.opentelemetry.io/contrib/instrumentation/runtime"
|
||||
"go.opentelemetry.io/otel"
|
||||
"go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc"
|
||||
|
@ -169,27 +167,27 @@ func InstrumentLogging(ctx context.Context, otlpEndpoint string) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func InstrumentProfiling(ctx context.Context) (func() error, error) {
|
||||
runtime.SetMutexProfileFraction(5)
|
||||
runtime.SetBlockProfileRate(5)
|
||||
// func InstrumentProfiling(ctx context.Context) (func() error, error) {
|
||||
// runtime.SetMutexProfileFraction(5)
|
||||
// runtime.SetBlockProfileRate(5)
|
||||
|
||||
// TODO or https://pkg.go.dev/net/http/pprof
|
||||
profiler, err := pyroscope.Start(pyroscope.Config{
|
||||
ApplicationName: NAME,
|
||||
ServerAddress: "",
|
||||
AuthToken: "",
|
||||
Logger: pyroscope.StandardLogger,
|
||||
ProfileTypes: []pyroscope.ProfileType{
|
||||
pyroscope.ProfileCPU,
|
||||
pyroscope.ProfileAllocObjects,
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
// // TODO or https://pkg.go.dev/net/http/pprof
|
||||
// profiler, err := pyroscope.Start(pyroscope.Config{
|
||||
// ApplicationName: NAME,
|
||||
// ServerAddress: "",
|
||||
// AuthToken: "",
|
||||
// Logger: pyroscope.StandardLogger,
|
||||
// ProfileTypes: []pyroscope.ProfileType{
|
||||
// pyroscope.ProfileCPU,
|
||||
// pyroscope.ProfileAllocObjects,
|
||||
// },
|
||||
// })
|
||||
// if err != nil {
|
||||
// return nil, err
|
||||
// }
|
||||
|
||||
return profiler.Stop, nil
|
||||
}
|
||||
// return profiler.Stop, nil
|
||||
// }
|
||||
|
||||
func InstrumentAll(ctx context.Context, otlpEndpoint string) (func(context.Context), error) {
|
||||
if len(otlpEndpoint) <= 0 {
|
||||
|
|
Loading…
Reference in a new issue