Skip to content

Commit

Permalink
Use one run method for all Prometheus metric types
Browse files Browse the repository at this point in the history
  • Loading branch information
jrauh01 committed Aug 19, 2024
1 parent f11ba7b commit 951f280
Show file tree
Hide file tree
Showing 3 changed files with 347 additions and 307 deletions.
4 changes: 1 addition & 3 deletions cmd/icinga-kubernetes/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,16 +111,14 @@ func main() {
}

promApiClient := promv1.NewAPI(promClient)
promMetricSync := metrics.NewPromMetricSync(promApiClient, db2)
promMetricSync := metrics.NewPromMetricSync(promApiClient, db2, logs.GetChildLogger("prom-metric-sync"))

g.Go(func() error {
return promMetricSync.Nodes(ctx, factory.Core().V1().Nodes().Informer())
})

g.Go(func() error {
return promMetricSync.Pods(ctx, factory.Core().V1().Pods().Informer())

//return promMetricSync.Run(ctx)
})
}

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ require (
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.19.1
github.com/prometheus/common v0.53.0
go.uber.org/zap v1.27.0
golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842
golang.org/x/sync v0.7.0
k8s.io/api v0.30.1
Expand Down Expand Up @@ -55,7 +56,6 @@ require (
github.com/ssgreg/journald v1.0.0 // indirect
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.10.0 // indirect
go.uber.org/zap v1.27.0 // indirect
golang.org/x/net v0.23.0 // indirect
golang.org/x/oauth2 v0.18.0 // indirect
golang.org/x/sys v0.18.0 // indirect
Expand Down
Loading

0 comments on commit 951f280

Please sign in to comment.