Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Kevin Lyda
gqgmc
Commits
6605c92a
Commit
6605c92a
authored
Feb 01, 2017
by
Kevin Lyda
💬
Browse files
More tweaks on web server.
parent
d072b3dd
Pipeline
#1219
passed with stage
in 1 minute
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
cmd/gqgmcd/main.go
View file @
6605c92a
...
...
@@ -8,15 +8,23 @@
package
main
import
(
"flag"
"fmt"
"log"
"net/http"
"github.com/prometheus/client_golang/prometheus/promhttp"
)
var
addr
=
flag
.
String
(
"listen-address"
,
":8080"
,
"Address for HTTP requests."
)
func
metricsHandler
(
w
http
.
ResponseWriter
,
r
*
http
.
Request
)
{
fmt
.
Fprintf
(
w
,
"Some metrics."
)
}
func
main
()
{
flag
.
Parse
()
http
.
HandleFunc
(
"/"
,
metricsHandler
)
http
.
ListenAndServe
(
":8080"
,
nil
)
http
.
Handle
(
"/metrics"
,
promhttp
.
Handler
())
log
.
Fatal
(
http
.
ListenAndServe
(
*
addr
,
nil
))
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment