Skip to content

Commit 657e242

Browse files
committed
add /metrics endpoint
1 parent 521f234 commit 657e242

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

cmd/webhook/main.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import (
88

99
"external-dns-openstack-webhook/internal/designate/provider"
1010

11+
"github.com/prometheus/client_golang/prometheus/promhttp"
12+
1113
"sigs.k8s.io/external-dns/endpoint"
1214
"sigs.k8s.io/external-dns/provider/webhook/api"
1315
)
@@ -29,6 +31,7 @@ func main() {
2931
w.WriteHeader(http.StatusInternalServerError)
3032
}
3133
})
34+
m.HandleFunc("/metrics", promhttp.Handler().ServeHTTP)
3235

3336
go func() {
3437
log.Debug("Starting status server on :8080")
@@ -47,7 +50,6 @@ func main() {
4750
}
4851
}()
4952

50-
5153
epf := endpoint.NewDomainFilter([]string{})
5254
dp, err := provider.NewDesignateProvider(epf, false)
5355
if err != nil {

0 commit comments

Comments
 (0)