Backend Plugins: Collect and expose metrics and plugin process health check (#21481)

Adds support for collecting metrics from backend plugins and 
exposing them thru Grafana's Prometheus metrics endpoint. 
Enables to check health of backend plugin by using the route
`/api/plugins/<plugin id>/health`.
Uses sdk v0.6.0.

Closes #20984
This commit is contained in:
Marcus Efraimsson
2020-01-15 13:10:48 +01:00
committed by GitHub
parent f56f54b1a3
commit 5c711bfb79
34 changed files with 2406 additions and 623 deletions

View File

@ -14,6 +14,7 @@ import (
"time"
"github.com/grafana/grafana/pkg/infra/log"
"github.com/grafana/grafana/pkg/infra/metrics"
"github.com/grafana/grafana/pkg/plugins/backendplugin"
"github.com/grafana/grafana/pkg/registry"
"github.com/grafana/grafana/pkg/setting"
@ -110,6 +111,12 @@ func (pm *PluginManager) Init() error {
app.initApp()
}
for _, p := range Plugins {
if !p.IsCorePlugin {
metrics.SetPluginBuildInformation(p.Id, p.Type, p.Info.Version)
}
}
return nil
}