mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Rendering: Add configuration options for renderKey lifetime (#57339)
* Add configuration options for `renderKey` lifetime * Rename config key to `render_key_lifetime` * Update conf/defaults.ini Co-authored-by: Joan López de la Franca Beltran <5459617+joanlopez@users.noreply.github.com> * Add `render_key_lifetime` to sample.ini Co-authored-by: Joan López de la Franca Beltran <5459617+joanlopez@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
90ac300d10
commit
e9dc7fb85c
@@ -1134,6 +1134,11 @@ renderer_token = -
|
||||
# Concurrent render request limit affects when the /render HTTP endpoint is used. Rendering many images at the same time can overload the server,
|
||||
# which this setting can help protect against by only allowing a certain amount of concurrent requests.
|
||||
concurrent_render_request_limit = 30
|
||||
# Determines the lifetime of the render key used by the image renderer to access and render Grafana.
|
||||
# This setting should be expressed as a duration. Examples: 10s (seconds), 5m (minutes), 2h (hours).
|
||||
# Default is 5m. This should be more than enough for most deployments.
|
||||
# Change the value only if image rendering is failing and you see `Failed to get the render key from cache` in Grafana logs.
|
||||
render_key_lifetime = 5m
|
||||
|
||||
[panels]
|
||||
# here for to support old env variables, can remove after a few months
|
||||
|
||||
@@ -1099,6 +1099,11 @@
|
||||
# Concurrent render request limit affects when the /render HTTP endpoint is used. Rendering many images at the same time can overload the server,
|
||||
# which this setting can help protect against by only allowing a certain amount of concurrent requests.
|
||||
;concurrent_render_request_limit = 30
|
||||
# Determines the lifetime of the render key used by the image renderer to access and render Grafana.
|
||||
# This setting should be expressed as a duration. Examples: 10s (seconds), 5m (minutes), 2h (hours).
|
||||
# Default is 5m. This should be more than enough for most deployments.
|
||||
# Change the value only if image rendering is failing and you see `Failed to get the render key from cache` in Grafana logs.
|
||||
;render_key_lifetime = 5m
|
||||
|
||||
[panels]
|
||||
# If set to true Grafana will allow script tags in text panels. Not recommended as it enable XSS vulnerabilities.
|
||||
@@ -1260,4 +1265,4 @@
|
||||
# Move a specific app plugin page (referenced by its `path` field) to a specific navigation section
|
||||
[navigation.app_standalone_pages]
|
||||
# The following will move the page with the path "/a/my-app-id/starred-content" from `my-app-id` to the `starred` section
|
||||
# /a/my-app-id/starred-content = starred
|
||||
# /a/my-app-id/starred-content = starred
|
||||
|
||||
@@ -91,7 +91,7 @@ func ProvideService(cfg *setting.Cfg, remoteCache *remotecache.RemoteCache, rm p
|
||||
perRequestRenderKeyProvider: &perRequestRenderKeyProvider{
|
||||
cache: remoteCache,
|
||||
log: logger,
|
||||
keyExpiry: 5 * time.Minute,
|
||||
keyExpiry: cfg.RendererRenderKeyLifeTime,
|
||||
},
|
||||
capabilities: []Capability{
|
||||
{
|
||||
|
||||
@@ -247,6 +247,7 @@ type Cfg struct {
|
||||
RendererCallbackUrl string
|
||||
RendererAuthToken string
|
||||
RendererConcurrentRequestLimit int
|
||||
RendererRenderKeyLifeTime time.Duration
|
||||
|
||||
// Security
|
||||
DisableInitAdminCreation bool
|
||||
@@ -1486,6 +1487,7 @@ func (cfg *Cfg) readRenderingSettings(iniFile *ini.File) error {
|
||||
}
|
||||
|
||||
cfg.RendererConcurrentRequestLimit = renderSec.Key("concurrent_render_request_limit").MustInt(30)
|
||||
cfg.RendererRenderKeyLifeTime = renderSec.Key("render_key_lifetime").MustDuration(5 * time.Minute)
|
||||
cfg.ImagesDir = filepath.Join(cfg.DataPath, "png")
|
||||
cfg.CSVsDir = filepath.Join(cfg.DataPath, "csv")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user