mirror of
https://github.com/grafana/grafana.git
synced 2025-08-03 04:04:14 +08:00
feat(instrumentation): check if enabled in http api metrics route
This commit is contained in:
@ -9,6 +9,7 @@ import (
|
||||
"github.com/grafana/grafana/pkg/api/dtos"
|
||||
"github.com/grafana/grafana/pkg/metrics"
|
||||
"github.com/grafana/grafana/pkg/middleware"
|
||||
"github.com/grafana/grafana/pkg/util"
|
||||
)
|
||||
|
||||
func GetTestMetrics(c *middleware.Context) {
|
||||
@ -40,6 +41,10 @@ func GetTestMetrics(c *middleware.Context) {
|
||||
}
|
||||
|
||||
func GetInternalMetrics(c *middleware.Context) Response {
|
||||
if metrics.UseNilMetrics {
|
||||
return Json(200, util.DynMap{"message": "Metrics disabled"})
|
||||
}
|
||||
|
||||
snapshots := metrics.MetricStats.GetSnapshots()
|
||||
|
||||
resp := make(map[string]interface{})
|
||||
|
Reference in New Issue
Block a user