feat(diagnostics): add pprof profiling (#1627)

* feat(tracing): enable tracing

* of course the squash didn't work.

* gah. always nice when there's 40 csets.

* might as well.

* refactor: tracing to diagnostics

* feat: add note about the magic methods from pprof

---------

Co-authored-by: ze0s <ze0s@riseup.net>
This commit is contained in:
Kyle Sanderson 2024-08-27 02:00:30 -07:00 committed by GitHub
parent 5ae4ed3604
commit 65d25c56c9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 63 additions and 0 deletions

View file

@ -14,6 +14,7 @@ import (
"github.com/autobrr/autobrr/internal/auth"
"github.com/autobrr/autobrr/internal/config"
"github.com/autobrr/autobrr/internal/database"
"github.com/autobrr/autobrr/internal/diagnostics"
"github.com/autobrr/autobrr/internal/download_client"
"github.com/autobrr/autobrr/internal/events"
"github.com/autobrr/autobrr/internal/feed"
@ -64,6 +65,8 @@ func main() {
// init dynamic config
cfg.DynamicReload(log)
diagnostics.SetupProfiling(cfg.Config.ProfilingEnabled, cfg.Config.ProfilingHost, cfg.Config.ProfilingPort)
// setup server-sent-events
serverEvents := sse.New()
serverEvents.CreateStreamWithOpts("logs", sse.StreamOpts{MaxEntries: 1000, AutoReplay: true})