Live: make maximum WebSocket message size configurable (#99770)
Co-authored-by: Chris Marchbanks <chris.marchbanks@grafana.com>
This commit is contained in:
co-authored by
Chris Marchbanks
parent
9d5af95565
commit
408e3e91a8
@@ -435,6 +435,9 @@ type Cfg struct {
|
||||
// LiveAllowedOrigins is a set of origins accepted by Live. If not provided
|
||||
// then Live uses AppURL as the only allowed origin.
|
||||
LiveAllowedOrigins []string
|
||||
// LiveMessageSizeLimit is the maximum size in bytes of Websocket messages
|
||||
// from clients. Defaults to 64KB.
|
||||
LiveMessageSizeLimit int
|
||||
|
||||
// Grafana.com URL, used for OAuth redirect.
|
||||
GrafanaComURL string
|
||||
@@ -1974,6 +1977,10 @@ func (cfg *Cfg) readLiveSettings(iniFile *ini.File) error {
|
||||
if cfg.LiveMaxConnections < -1 {
|
||||
return fmt.Errorf("unexpected value %d for [live] max_connections", cfg.LiveMaxConnections)
|
||||
}
|
||||
cfg.LiveMessageSizeLimit = section.Key("message_size_limit").MustInt(65536)
|
||||
if cfg.LiveMessageSizeLimit < -1 {
|
||||
return fmt.Errorf("unexpected value %d for [live] message_size_limit", cfg.LiveMaxConnections)
|
||||
}
|
||||
cfg.LiveHAEngine = section.Key("ha_engine").MustString("")
|
||||
switch cfg.LiveHAEngine {
|
||||
case "", "redis":
|
||||
|
||||
Reference in New Issue
Block a user