mirror of
https://github.com/grafana/grafana.git
synced 2025-07-28 19:42:44 +08:00
Plugins: Update collect metrics handler to latest signature (#45166)
* use updated collect metrics handler * use proto helper
This commit is contained in:
@ -230,12 +230,7 @@ func (hs *HTTPServer) GetPluginMarkdown(c *models.ReqContext) response.Response
|
||||
// /api/plugins/:pluginId/metrics
|
||||
func (hs *HTTPServer) CollectPluginMetrics(c *models.ReqContext) response.Response {
|
||||
pluginID := web.Params(c.Req)[":pluginId"]
|
||||
plugin, exists := hs.pluginStore.Plugin(c.Req.Context(), pluginID)
|
||||
if !exists {
|
||||
return response.Error(404, "Plugin not found", nil)
|
||||
}
|
||||
|
||||
resp, err := hs.pluginClient.CollectMetrics(c.Req.Context(), plugin.ID)
|
||||
resp, err := hs.pluginClient.CollectMetrics(c.Req.Context(), &backend.CollectMetricsRequest{PluginContext: backend.PluginContext{PluginID: pluginID}})
|
||||
if err != nil {
|
||||
return translatePluginRequestErrorToAPIError(err)
|
||||
}
|
||||
|
Reference in New Issue
Block a user