Skip to content

Commit

Permalink
h err
Browse files Browse the repository at this point in the history
  • Loading branch information
omersiar authored Jul 20, 2023
1 parent 4e43c52 commit 481cdf9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ var reqCounter = prometheus.NewCounter(

func sendEpoch(w http.ResponseWriter, r *http.Request) {
epoch := time.Now().UTC().Unix()
hostname := os.Hostname()
hostname, err := os.Hostname()
if err != nil {
fmt.Println(err)
}
reqCounter.Inc()
fmt.Fprintf(w, "{\"host\": %s, \"type\": \"epoch\", \"data\": %d, \"unit\": \"sec\", \"rev\": %q}", hostname, epoch, Version)
}
Expand Down

0 comments on commit 481cdf9

Please sign in to comment.