Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pqlog
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
smol
pqlog
Commits
9d5edc8d
Commit
9d5edc8d
authored
1 year ago
by
ale
Browse files
Options
Downloads
Patches
Plain Diff
Add simple liveness endpoint
parent
7ce6a809
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#62731
passed
1 year ago
Stage: test
Stage: build
Stage: release
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cmd/pqlogd/main.go
+6
-0
6 additions, 0 deletions
cmd/pqlogd/main.go
with
6 additions
and
0 deletions
cmd/pqlogd/main.go
+
6
−
0
View file @
9d5edc8d
...
...
@@ -4,6 +4,7 @@ import (
"context"
"crypto/tls"
"flag"
"io"
"log"
"net"
"net/http"
...
...
@@ -47,6 +48,7 @@ func main() {
mux
:=
http
.
NewServeMux
()
mux
.
Handle
(
"/metrics"
,
promhttp
.
Handler
())
mux
.
HandleFunc
(
"/health"
,
livenessHandler
)
src
,
err
:=
uri
.
Source
()
if
err
!=
nil
{
...
...
@@ -133,6 +135,10 @@ func buildListener() (net.Listener, error) {
return
l
,
nil
}
func
livenessHandler
(
w
http
.
ResponseWriter
,
_
*
http
.
Request
)
{
io
.
WriteString
(
w
,
"OK"
)
// nolint:errcheck
}
// Instrumentation.
func
instrumentedHandler
(
h
http
.
Handler
,
name
string
,
withRequestSize
bool
)
http
.
Handler
{
labels
:=
prometheus
.
Labels
{
"handler"
:
name
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment