mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
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)
|
||||
}
|
||||
|
@@ -21,5 +21,8 @@ var (
|
||||
M_Api_Login_OAuth = NewComboCounterRef("api.login.oauth")
|
||||
M_Api_Org_Create = NewComboCounterRef("api.org.create")
|
||||
|
||||
M_Api_Dashboard_Snapshot_Create = NewComboCounterRef("api.dashboard_snapshot.create")
|
||||
M_Api_Dashboard_Snapshot_Get = NewComboCounterRef("api.dashboard_snapshot.get")
|
||||
|
||||
M_Models_Dashboard_Insert = NewComboCounterRef("models.dashboard.insert")
|
||||
)
|
||||
|
Reference in New Issue
Block a user