Skip to content

Commit

Permalink
Dependencies update & making prometheus endpoint set up async
Browse files Browse the repository at this point in the history
  • Loading branch information
joe94 committed Nov 28, 2017
1 parent 1f5ad5e commit d888a61
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 5 deletions.
29 changes: 28 additions & 1 deletion src/glide.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 7 additions & 4 deletions src/tr1d1um/tr1d1um.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,13 @@ func tr1d1um(arguments []string) (exitCode int) {

go snsFactory.PrepareAndStart()

// prometheus metrics set up
http.Handle("/metrics", promhttp.Handler())
if prometheusEndpointErr := http.ListenAndServe(":8080", nil); prometheusEndpointErr != nil {
errorLogger.Log(logging.MessageKey(), "error with prometheus endpoint", logging.ErrorKey(), prometheusEndpointErr)
}
go func() {
if prometheusEndpointErr := http.ListenAndServe(":8080", nil); prometheusEndpointErr != nil {
errorLogger.Log(logging.MessageKey(), "error with prometheus endpoint", logging.ErrorKey(), prometheusEndpointErr)
}
}()

if err := concurrent.Await(tr1d1umServer, signals); err != nil {
fmt.Fprintf(os.Stderr, "Error when starting %s: %s", applicationName, err)
Expand Down Expand Up @@ -329,6 +332,6 @@ func main() {
}

func init() {
// Metrics have to be registered to be exposed:
// Metrics values must be registered to be exposed:
prometheus.MustRegister(requestsReceived)
}

0 comments on commit d888a61

Please sign in to comment.