Added dashboard snapshot metrics
This commit is contained in:
@@ -3,6 +3,7 @@ package api
|
||||
import (
|
||||
"github.com/grafana/grafana/pkg/api/dtos"
|
||||
"github.com/grafana/grafana/pkg/bus"
|
||||
"github.com/grafana/grafana/pkg/metrics"
|
||||
"github.com/grafana/grafana/pkg/middleware"
|
||||
m "github.com/grafana/grafana/pkg/models"
|
||||
"github.com/grafana/grafana/pkg/util"
|
||||
@@ -16,6 +17,8 @@ func CreateDashboardSnapshot(c *middleware.Context, cmd m.CreateDashboardSnapsho
|
||||
return
|
||||
}
|
||||
|
||||
metrics.M_Api_Dashboard_Snapshot_Create.Inc(1)
|
||||
|
||||
c.JSON(200, util.DynMap{"key": cmd.Key})
|
||||
}
|
||||
|
||||
@@ -35,6 +38,9 @@ func GetDashboardSnapshot(c *middleware.Context) {
|
||||
Meta: dtos.DashboardMeta{IsSnapshot: true},
|
||||
}
|
||||
|
||||
metrics.M_Api_Dashboard_Snapshot_Get.Inc(1)
|
||||
|
||||
c.Resp.Header().Set("Cache-Control", "public, max-age=31536000")
|
||||
|
||||
c.JSON(200, dto)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user