Commit 7cbaf060 by Torkel Ödegaard

feat(instrumentation): check if enabled in http api metrics route

parent 1059a35b
......@@ -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{})
......
......@@ -38,7 +38,7 @@ func readSettings() *MetricSettings {
if graphitePublisher, err := CreateGraphitePublisher(); err != nil {
log.Error(3, "Metrics: Failed to init Graphite metric publisher", err)
} else if graphitePublisher != nil {
log.Info("Metrics: Internal metrics publisher Graphite initialized")
log.Info("Metrics: Graphite publisher initialized")
settings.Publishers = append(settings.Publishers, graphitePublisher)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment