Renderer: add version information (#34964)
* Renderer: add version information * fix alerting test
This commit is contained in:
@@ -47,6 +47,7 @@ type RenderingService struct {
|
||||
renderCSVAction renderCSVFunc
|
||||
domain string
|
||||
inProgressCount int
|
||||
version string
|
||||
|
||||
Cfg *setting.Cfg `inject:""`
|
||||
RemoteCacheService *remotecache.RemoteCache `inject:""`
|
||||
@@ -86,7 +87,14 @@ func (rs *RenderingService) Init() error {
|
||||
func (rs *RenderingService) Run(ctx context.Context) error {
|
||||
if rs.remoteAvailable() {
|
||||
rs.log = rs.log.New("renderer", "http")
|
||||
rs.log.Info("Backend rendering via external http server")
|
||||
|
||||
version, err := rs.getRemotePluginVersion()
|
||||
if err != nil {
|
||||
rs.log.Info("Couldn't get remote renderer version", "err", err)
|
||||
}
|
||||
|
||||
rs.log.Info("Backend rendering via external http server", "version", version)
|
||||
rs.version = version
|
||||
rs.renderAction = rs.renderViaHTTP
|
||||
rs.renderCSVAction = rs.renderCSVViaHTTP
|
||||
<-ctx.Done()
|
||||
@@ -101,6 +109,7 @@ func (rs *RenderingService) Run(ctx context.Context) error {
|
||||
return err
|
||||
}
|
||||
|
||||
rs.version = rs.pluginInfo.Info.Version
|
||||
rs.renderAction = rs.renderViaPlugin
|
||||
rs.renderCSVAction = rs.renderCSVViaPlugin
|
||||
<-ctx.Done()
|
||||
@@ -127,6 +136,10 @@ func (rs *RenderingService) IsAvailable() bool {
|
||||
return rs.remoteAvailable() || rs.pluginAvailable()
|
||||
}
|
||||
|
||||
func (rs *RenderingService) Version() string {
|
||||
return rs.version
|
||||
}
|
||||
|
||||
func (rs *RenderingService) RenderErrorImage(err error) (*RenderResult, error) {
|
||||
imgUrl := "public/img/rendering_error.png"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user