Struct merino_settings::Settings
source · [−]pub struct Settings {Show 14 fields
pub env: String,
pub debug: bool,
pub http: HttpSettings,
pub provider_settings: ProviderSettings,
pub suggestion_providers: HashMap<String, SuggestionProviderConfig>,
pub logging: LoggingSettings,
pub metrics: MetricsSettings,
pub sentry: SentrySettings,
pub public_documentation: Option<Uri>,
pub redis: RedisSettings,
pub remote_settings: RemoteSettingsGlobalSettings,
pub location: LocationSettings,
pub log_full_request: bool,
pub elasticsearch: ElasticsearchSettings,
}
Expand description
Top level settings object for Merino.
Fields
env: String
The environment Merino is running in. Should only be set with the
MERINO__ENV
environment variable.
debug: bool
Enable additional features to debug the application. This should not be set to true in production environments.
http: HttpSettings
Settings for the HTTP server.
provider_settings: ProviderSettings
Settings for the suggestion providers
suggestion_providers: HashMap<String, SuggestionProviderConfig>
Providers to use to generate suggestions
logging: LoggingSettings
Logging settings.
metrics: MetricsSettings
Metrics settings.
sentry: SentrySettings
Settings for error reporting via Sentry.
public_documentation: Option<Uri>
URL to redirect curious users to, that explains what this service is. Preferable a public wiki page. Optional.
redis: RedisSettings
Settings for connecting to Redis.
remote_settings: RemoteSettingsGlobalSettings
Settings for connecting to Remote Settings.
location: LocationSettings
Settings to use when determining the location associated with requests.
log_full_request: bool
If on, log the entire suggestion request object as a part of the tracing log, including the search query. When the setting is off, the suggest request object should be logged, but the search query should be blank.
elasticsearch: ElasticsearchSettings
Implementations
sourceimpl Settings
impl Settings
sourcepub async fn load() -> Result<Self>
pub async fn load() -> Result<Self>
Load settings from configuration files and environment variables.
Errors
If any of the configured values are invalid, or if any of the required configuration files are missing.
sourcepub fn load_for_tests() -> Self
pub fn load_for_tests() -> Self
Load settings from configuration files for tests.
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Settings
impl<'de> Deserialize<'de> for Settings
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations
impl RefUnwindSafe for Settings
impl Send for Settings
impl Sync for Settings
impl Unpin for Settings
impl UnwindSafe for Settings
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more