Skip to content

Commit 87487fa

Browse files
committed
add metrics tls param to the server config
1 parent 2ca2df9 commit 87487fa

1 file changed

Lines changed: 28 additions & 3 deletions

File tree

servercfg/config.go

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,12 @@ type DoltgresPerformanceConfig struct {
144144
}
145145

146146
type DoltgesMetricsConfig struct {
147-
Labels map[string]string `yaml:"labels,omitempty" minver:"0.7.4"`
148-
Host *string `yaml:"host,omitempty" minver:"0.7.4"`
149-
Port *int `yaml:"port,omitempty" minver:"0.7.4"`
147+
Labels map[string]string `yaml:"labels,omitempty" minver:"0.7.4"`
148+
Host *string `yaml:"host,omitempty" minver:"0.7.4"`
149+
Port *int `yaml:"port,omitempty" minver:"0.7.4"`
150+
TlsCert *string `yaml:"tls_cert,omitempty" minver:"TBD"`
151+
TlsKey *string `yaml:"tls_key,omitempty" minver:"TBD"`
152+
TlsCa *string `yaml:"tls_ca,omitempty" minver:"TBD"`
150153
}
151154

152155
type DoltgresRemotesapiConfig struct {
@@ -397,6 +400,28 @@ func (cfg *DoltgresConfig) MetricsPort() int {
397400
return *cfg.MetricsConfig.Port
398401
}
399402

403+
func (cfg *DoltgresConfig) MetricsTLSCert() string {
404+
if cfg.MetricsConfig.TlsCert == nil {
405+
return ""
406+
}
407+
408+
return *cfg.MetricsConfig.TlsCert
409+
}
410+
411+
func (cfg *DoltgresConfig) MetricsTLSKey() string {
412+
if cfg.MetricsConfig.TlsKey == nil {
413+
return ""
414+
}
415+
return *cfg.MetricsConfig.TlsKey
416+
}
417+
418+
func (cfg *DoltgresConfig) MetricsTLSCA() string {
419+
if cfg.MetricsConfig.TlsCa == nil {
420+
return ""
421+
}
422+
return *cfg.MetricsConfig.TlsCa
423+
}
424+
400425
func (cfg *DoltgresConfig) PrivilegeFilePath() string {
401426
if cfg.PrivilegeFile == nil {
402427
return ""

0 commit comments

Comments
 (0)