From fb91a426a8615c6679e920c0da822de6cbc56eee Mon Sep 17 00:00:00 2001 From: Jigar Joshi Date: Wed, 17 Aug 2022 23:12:30 -0700 Subject: [PATCH] fix: Fixed observability config structure --- server/config/options.go | 12 ++++++------ server/services/v1/observability.go | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/server/config/options.go b/server/config/options.go index 708e84c21..005235c08 100644 --- a/server/config/options.go +++ b/server/config/options.go @@ -97,11 +97,11 @@ type SearchMetricsConfig struct { } type ObservabilityConfig struct { - Provider string `yaml:"provider" json:"provider"` - EnableObservabilityService bool `yaml:"enable_observability_service" json:"enable_observability_service"` - ApiKey string `yaml:"api_key" json:"api_key"` - AppKey string `yaml:"app_key" json:"app_key"` - ProviderUrl string `yaml:"provider_url" json:"provider_url"` + Provider string `mapstructure:"provider" yaml:"provider" json:"provider"` + Enabled bool `mapstructure:"enabled" yaml:"enabled" json:"enabled"` + ApiKey string `mapstructure:"api_key" yaml:"api_key" json:"api_key"` + AppKey string `mapstructure:"app_key" yaml:"app_key" json:"app_key"` + ProviderUrl string `mapstructure:"provider_url" yaml:"provider_url" json:"provider_url"` } var DefaultConfig = Config{ @@ -152,7 +152,7 @@ var DefaultConfig = Config{ DataSizeLimit: 10000000000, // bytes }, Observability: ObservabilityConfig{ - EnableObservabilityService: false, + Enabled: false, }, } diff --git a/server/services/v1/observability.go b/server/services/v1/observability.go index 0b7976c25..5fcba7d6b 100644 --- a/server/services/v1/observability.go +++ b/server/services/v1/observability.go @@ -141,7 +141,7 @@ func newObservabilityService() *observabilityService { } } log.Error().Str("observabilityProvider", config.DefaultConfig.Observability.Provider).Msg("Unable to configure external observability provider") - if config.DefaultConfig.Observability.EnableObservabilityService { + if config.DefaultConfig.Observability.Enabled { panic("Unable to configure external observability provider") } return nil