add component monitoring

Signed-off-by: huanggze <loganhuang@yunify.com>
This commit is contained in:
huanggze
2019-04-10 11:21:29 +08:00
committed by zryfish
parent 17e09190be
commit 3a3e49547b
6 changed files with 174 additions and 19 deletions

View File

@@ -247,6 +247,13 @@ func addWebService(c *restful.Container) error {
Consumes(restful.MIME_JSON, restful.MIME_XML).
Produces(restful.MIME_JSON)
ws.Route(ws.GET("/components/{component}").To(monitoring.MonitorComponent).
Doc("monitor component level metrics").
Param(ws.QueryParameter("metrics_filter", "metrics names in re2 regex").DataType("string").Required(false).DefaultValue("")).
Metadata(restfulspec.KeyOpenAPITags, tags)).
Consumes(restful.MIME_JSON, restful.MIME_XML).
Produces(restful.MIME_JSON)
c.Add(ws)
return nil
}