mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 16:59:12 +00:00
feat(metrics): add metrics server (#1930)
* feat(metrics): add metrics server * chore: update license headers * feat(metrics): add optional basic auth * feat(metrics): add go and process collectors --------- Co-authored-by: ze0s <43699394+zze0s@users.noreply.github.com> Co-authored-by: ze0s <ze0s@riseup.net>
This commit is contained in:
parent
0d5902c8f6
commit
3f8bc0140c
16 changed files with 1191 additions and 83 deletions
|
@ -27,6 +27,7 @@ import (
|
|||
"github.com/autobrr/autobrr/internal/irc"
|
||||
"github.com/autobrr/autobrr/internal/list"
|
||||
"github.com/autobrr/autobrr/internal/logger"
|
||||
"github.com/autobrr/autobrr/internal/metrics"
|
||||
"github.com/autobrr/autobrr/internal/notification"
|
||||
"github.com/autobrr/autobrr/internal/proxy"
|
||||
"github.com/autobrr/autobrr/internal/release"
|
||||
|
@ -176,6 +177,22 @@ func main() {
|
|||
errorChannel <- httpServer.Open()
|
||||
}()
|
||||
|
||||
if cfg.Config.MetricsEnabled {
|
||||
metricsManager := metrics.NewMetricsManager(version, commit, date, releaseService, ircService, feedService, listService, filterService)
|
||||
|
||||
go func() {
|
||||
httpMetricsServer := http.NewMetricsServer(
|
||||
log,
|
||||
cfg,
|
||||
version,
|
||||
commit,
|
||||
date,
|
||||
metricsManager,
|
||||
)
|
||||
errorChannel <- httpMetricsServer.Open()
|
||||
}()
|
||||
}
|
||||
|
||||
sigCh := make(chan os.Signal, 1)
|
||||
signal.Notify(sigCh, syscall.SIGHUP, syscall.SIGINT, syscall.SIGQUIT, syscall.SIGTERM)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue