Skip to content

Commit

Permalink
Merge pull request #64 from messagebird/add-live-and-ready-endpoint
Browse files Browse the repository at this point in the history
Add live and ready endpoint for probes.
  • Loading branch information
marcelcorso authored Sep 6, 2019
2 parents 92c7cf5 + b89cd5c commit b818f95
Show file tree
Hide file tree
Showing 19 changed files with 1,006 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cmd/sachet/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ import (

"github.com/prometheus/alertmanager/template"
"github.com/prometheus/client_golang/prometheus"

"github.com/heptiolabs/healthcheck"
)

var (
Expand Down Expand Up @@ -129,6 +131,11 @@ func main() {
}
})

hc := healthcheck.NewMetricsHandler(prometheus.DefaultRegisterer, "sachet")

http.HandleFunc("/-/live", hc.LiveEndpoint)
http.HandleFunc("/-/ready", hc.ReadyEndpoint)

if os.Getenv("PORT") != "" {
*listenAddress = ":" + os.Getenv("PORT")
}
Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ require (
github.com/davecgh/go-spew v1.1.0 // indirect
github.com/go-telegram-bot-api/telegram-bot-api v4.6.4+incompatible // indirect
github.com/golang/protobuf v1.1.0 // indirect
github.com/heptiolabs/healthcheck v0.0.0-20180807145615-6ff867650f40
github.com/matttproud/golang_protobuf_extensions v1.0.0 // indirect
github.com/messagebird/go-rest-api v0.0.0-20180517131710-a9514230491e
github.com/pmezard/go-difflib v1.0.0 // indirect
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ github.com/go-telegram-bot-api/telegram-bot-api v4.6.4+incompatible h1:2cauKuaEL
github.com/go-telegram-bot-api/telegram-bot-api v4.6.4+incompatible/go.mod h1:qf9acutJ8cwBUhm1bqgz6Bei9/C/c93FPDljKWwsOgM=
github.com/golang/protobuf v1.1.0 h1:0iH4Ffd/meGoXqF2lSAhZHt8X+cPgkfn/cb6Cce5Vpc=
github.com/golang/protobuf v1.1.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/heptiolabs/healthcheck v0.0.0-20180807145615-6ff867650f40 h1:GT4RsKmHh1uZyhmTkWJTDALRjSHYQp6FRKrotf0zhAs=
github.com/heptiolabs/healthcheck v0.0.0-20180807145615-6ff867650f40/go.mod h1:NtmN9h8vrTveVQRLHcX2HQ5wIPBDCsZ351TGbZWgg38=
github.com/matttproud/golang_protobuf_extensions v1.0.0 h1:YNOwxxSJzSUARoD9KRZLzM9Y858MNGCOACTvCW9TSAc=
github.com/matttproud/golang_protobuf_extensions v1.0.0/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
github.com/messagebird/go-rest-api v0.0.0-20180517131710-a9514230491e h1:hsSmRHe7psyLMQ/Kn8xgr0koZKB4rfgO4dsKgP6S4Dc=
Expand Down
1 change: 1 addition & 0 deletions vendor/github.com/heptiolabs/healthcheck/.gitignore

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

13 changes: 13 additions & 0 deletions vendor/github.com/heptiolabs/healthcheck/.travis.yml

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

37 changes: 37 additions & 0 deletions vendor/github.com/heptiolabs/healthcheck/CODE_OF_CONDUCT.md

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

57 changes: 57 additions & 0 deletions vendor/github.com/heptiolabs/healthcheck/CONTRIBUTING.md

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

87 changes: 87 additions & 0 deletions vendor/github.com/heptiolabs/healthcheck/Gopkg.lock

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

10 changes: 10 additions & 0 deletions vendor/github.com/heptiolabs/healthcheck/Gopkg.toml

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

Loading

0 comments on commit b818f95

Please sign in to comment.