Skip to content

Commit

Permalink
Moved http handler (#9)
Browse files Browse the repository at this point in the history
Co-authored-by: Pawel Cendrzak <[email protected]>
  • Loading branch information
pabloxxl and Pawel Cendrzak authored Oct 17, 2024
1 parent f09eeb3 commit f741a6f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions cmd/podman_events_exporter/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ func printBuildData() {
}

func loop(config *utils.ConfigOpts) {
klog.Infof("Listening on %s/metrics", config.HostWithPort)
http.Handle("/metrics", promhttp.Handler())

ctx, err := utils.ConnectToPodmanSocket(config.Socket)
if err != nil {
os.Exit(1)
Expand Down Expand Up @@ -72,8 +75,6 @@ func loop(config *utils.ConfigOpts) {
utils.GetInfoLabels(ctx)
go utils.CreateListener(ctx, &eventChan, &exitChan, &breakChan)

klog.Infof("Listening on %s/metrics", config.HostWithPort)
http.Handle("/metrics", promhttp.Handler())
go http.ListenAndServe(config.HostWithPort, nil)

for run {
Expand Down
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1.4
0.1.5

0 comments on commit f741a6f

Please sign in to comment.