From b75edac0a7552a32bb80c62a6d7251f95b44742c Mon Sep 17 00:00:00 2001 From: Pavel Tatarskiy Date: Thu, 2 Feb 2023 20:57:30 +0300 Subject: [PATCH] add prometheus endpoint --- Dockerfile | 5 +---- configure.go | 7 ++++++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3e96415..6164e79 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,9 +6,6 @@ WORKDIR /app # copy the source files COPY . . -# enable modules -ENV GO111MODULE=on - # disable crosscompiling ENV CGO_ENABLED=0 @@ -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"] diff --git a/configure.go b/configure.go index 1022e2f..701b429 100644 --- a/configure.go +++ b/configure.go @@ -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 @@ -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() @@ -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()