|
|
|
@ -11,6 +11,7 @@ import ( |
|
|
|
"math" |
|
|
|
|
|
|
|
"github.com/gin-gonic/gin" |
|
|
|
"github.com/prometheus/client_golang/prometheus/promhttp" |
|
|
|
"github.com/yedf/dtm/common" |
|
|
|
"github.com/yedf/dtm/dtmcli" |
|
|
|
"github.com/yedf/dtm/dtmcli/dtmimp" |
|
|
|
@ -26,6 +27,12 @@ func addRoute(engine *gin.Engine) { |
|
|
|
engine.POST("/api/dtmsvr/registerTccBranch", common.WrapHandler(registerBranch)) // compatible for old sdk
|
|
|
|
engine.GET("/api/dtmsvr/query", common.WrapHandler(query)) |
|
|
|
engine.GET("/api/dtmsvr/all", common.WrapHandler(all)) |
|
|
|
|
|
|
|
// add prometheus exporter
|
|
|
|
h := promhttp.Handler() |
|
|
|
engine.GET("/api/metrics", func(c *gin.Context) { |
|
|
|
h.ServeHTTP(c.Writer, c.Request) |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
func newGid(c *gin.Context) (interface{}, error) { |
|
|
|
|