[v9.5.x] SQL Datasources: Update behavior of default connection limits (#67465)
* SQL Datasources: Update behavior of default connection limits (#66687) * Update behavior of defaults in connection limits * Refactor to use config object instead * Refactor remove unneeded function --------- Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com> (cherry picked from commit1fbac96bd4) * SQL Datasources: Update behavior of default connection limits (#66687) * Update behavior of defaults in connection limits * Refactor to use config object instead * Refactor remove unneeded function --------- Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com> (cherry picked from commit1fbac96bd4) --------- Co-authored-by: Kyle Cunningham <codeincarnate@users.noreply.github.com> Co-authored-by: Kyle Cunningham <kyle@codeincarnate.com>
This commit is contained in:
co-authored by
Kyle Cunningham
Kyle Cunningham
parent
ff79e2df57
commit
792e80b65d
@@ -121,6 +121,12 @@ type FrontendSettingsWhitelabelingDTO struct {
|
||||
PublicDashboardFooter *FrontendSettingsPublicDashboardFooterConfigDTO `json:"publicDashboardFooter,omitempty"` // PR TODO: type this properly
|
||||
}
|
||||
|
||||
type FrontendSettingsSqlConnectionLimitsDTO struct {
|
||||
MaxOpenConns int `json:"maxOpenConns"`
|
||||
MaxIdleConns int `json:"maxIdleConns"`
|
||||
ConnMaxLifetime int `json:"connMaxLifetime"`
|
||||
}
|
||||
|
||||
type FrontendSettingsDTO struct {
|
||||
DefaultDatasource string `json:"defaultDatasource"`
|
||||
Datasources map[string]plugins.DataSourceDTO `json:"datasources"`
|
||||
@@ -223,6 +229,8 @@ type FrontendSettingsDTO struct {
|
||||
|
||||
PluginsCDNBaseURL string `json:"pluginsCDNBaseURL,omitempty"`
|
||||
|
||||
SqlConnectionLimits FrontendSettingsSqlConnectionLimitsDTO `json:"sqlConnectionLimits"`
|
||||
|
||||
// Enterprise
|
||||
Licensing *FrontendSettingsLicensingDTO `json:"licensing,omitempty"`
|
||||
Whitelabeling *FrontendSettingsWhitelabelingDTO `json:"whitelabeling,omitempty"`
|
||||
|
||||
@@ -215,6 +215,12 @@ func (hs *HTTPServer) getFrontendSettings(c *contextmodel.ReqContext) (*dtos.Fro
|
||||
TokenExpirationDayLimit: hs.Cfg.SATokenExpirationDayLimit,
|
||||
|
||||
SnapshotEnabled: hs.Cfg.SnapshotEnabled,
|
||||
|
||||
SqlConnectionLimits: dtos.FrontendSettingsSqlConnectionLimitsDTO{
|
||||
MaxOpenConns: hs.Cfg.SqlDatasourceMaxOpenConnsDefault,
|
||||
MaxIdleConns: hs.Cfg.SqlDatasourceMaxIdleConnsDefault,
|
||||
ConnMaxLifetime: hs.Cfg.SqlDatasourceMaxConnLifetimeDefault,
|
||||
},
|
||||
}
|
||||
|
||||
if hs.Cfg.UnifiedAlerting.Enabled != nil {
|
||||
|
||||
Reference in New Issue
Block a user