mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
add pprof endpoints, additional spans (#770)
i would split this commit in two if i were a good dev. the pprof stuff is really useful and this only samples when called. this is pretty standard go service stuff. expvar is cool, too. the additional spannos have turned up some interesting tid bits... gonna slide em in
This commit is contained in:
@@ -305,7 +305,9 @@ func WithTracer(zipkinURL string) ServerOption {
|
||||
|
||||
if zipkinHTTPEndpoint != "" {
|
||||
// Custom PrometheusCollector and Zipkin HTTPCollector
|
||||
httpCollector, zipErr := zipkintracer.NewHTTPCollector(zipkinHTTPEndpoint, zipkintracer.HTTPLogger(logger))
|
||||
httpCollector, zipErr := zipkintracer.NewHTTPCollector(zipkinHTTPEndpoint,
|
||||
zipkintracer.HTTPLogger(logger), zipkintracer.HTTPMaxBacklog(1000),
|
||||
)
|
||||
if zipErr != nil {
|
||||
logrus.WithError(zipErr).Fatalln("couldn't start Zipkin trace collector")
|
||||
}
|
||||
@@ -436,6 +438,8 @@ func (s *Server) bindHandlers(ctx context.Context) {
|
||||
engine.GET("/stats", s.handleStats)
|
||||
engine.GET("/metrics", s.handlePrometheusMetrics)
|
||||
|
||||
profilerSetup(engine, "/debug")
|
||||
|
||||
if s.nodeType != ServerTypeRunner {
|
||||
v1 := engine.Group("/v1")
|
||||
v1.Use(setAppNameInCtx)
|
||||
|
||||
Reference in New Issue
Block a user