Skip to content

Commit

Permalink
add prometheus endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
vintikzzz committed Feb 2, 2023
1 parent a42debe commit b75edac
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
5 changes: 1 addition & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ WORKDIR /app
# copy the source files
COPY . .

# enable modules
ENV GO111MODULE=on

# disable crosscompiling
ENV CGO_ENABLED=0

Expand All @@ -24,7 +21,7 @@ FROM alpine:latest
COPY --from=build /app/server .

# tell we are exposing our services
EXPOSE 8080 8081 8082
EXPOSE 8080 8081 8082 8083

# run it!
CMD ["./server"]
7 changes: 6 additions & 1 deletion configure.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ func configure(app *cli.App) {
app.Flags = []cli.Flag{}
app.Flags = cs.RegisterProbeFlags(app.Flags)
app.Flags = cs.RegisterPprofFlags(app.Flags)
app.Flags = cs.RegisterPromFlags(app.Flags)
app.Flags = s.RegisterWebFlags(app.Flags)
app.Flags = s.RegisterTorrentStoreClientFlags(app.Flags)
app.Action = run
Expand All @@ -25,6 +26,10 @@ func run(c *cli.Context) error {
pprof := cs.NewPprof(c)
defer pprof.Close()

// Setting PromService
prom := cs.NewProm(c)
defer prom.Close()

// Setting TorrentStoreCLient
torrentStoreClient := s.NewTorrentStoreClient(c)
defer torrentStoreClient.Close()
Expand All @@ -37,7 +42,7 @@ func run(c *cli.Context) error {
defer web.Close()

// Setting ServeService
serve := cs.NewServe(probe, pprof, web)
serve := cs.NewServe(probe, pprof, prom, web)

// And SERVE!
err := serve.Serve()
Expand Down

0 comments on commit b75edac

Please sign in to comment.