From eede5239992079d0a5a0956f57983527f2c6f080 Mon Sep 17 00:00:00 2001 From: postmannen Date: Fri, 10 Sep 2021 05:44:26 +0200 Subject: [PATCH] added httpreader handlefunc --- Dockerfile | 2 ++ read_socket_or_tcp_listener.go | 4 +--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index b7360cc..9ce6f13 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,6 +20,7 @@ COPY --from=build-env /build/cmd/steward/steward /app/ ENV CONFIG_FOLDER "./etc" ENV SOCKET_FOLDER "./tmp" ENV TCP_LISTENER "" +ENV HTTP_LISTENER "localhost:8091" ENV DATABASE_FOLDER "./var/lib" ENV NODE_NAME "" ENV BROKER_ADDRESS "127.0.0.1:4222" @@ -54,6 +55,7 @@ ENV START_SUB_REQ_N_CLI_COMMAND_CONT "" CMD ["ash","-c","env CONFIGFOLDER=./etc/ /app/steward\ -socketFolder=$SOCKET_FOLDER\ -tcpListener=$TCP_LISTENER\ + -httpListener=$HTTP_LISTENER\ -databaseFolder=$DATABASE_FOLDER\ -nodeName=$NODE_NAME\ -brokerAddress=$BROKER_ADDRESS\ diff --git a/read_socket_or_tcp_listener.go b/read_socket_or_tcp_listener.go index f8e456c..1f00c34 100644 --- a/read_socket_or_tcp_listener.go +++ b/read_socket_or_tcp_listener.go @@ -9,8 +9,6 @@ import ( "net" "net/http" "os" - - "github.com/prometheus/client_golang/prometheus/promhttp" ) // readSocket will read the .sock file specified. @@ -160,7 +158,7 @@ func (s *server) readHttpListener() { os.Exit(1) } mux := http.NewServeMux() - mux.Handle("/metrics", promhttp.Handler()) + mux.HandleFunc("/metrics", s.readHTTPlistenerHandler) err = http.Serve(n, mux) if err != nil {