| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Hermod.Tracing.ConfigurationParser
Contents
Synopsis
- data ConfigSource
- mkConfiguration :: TraceConfig
- mkConfigurationWithFallback :: SeverityS -> DetailLevel -> BackendConfig -> TraceConfig
- readConfiguration :: ConfigSource -> IO TraceConfig
- readConfigurationWithFallback :: SeverityS -> DetailLevel -> BackendConfig -> ConfigSource -> IO TraceConfig
- readConfiguration' :: FilePath -> IO TraceConfig
- readConfigurationWithFallback' :: SeverityS -> DetailLevel -> BackendConfig -> FilePath -> IO TraceConfig
- readConfigurationWithDefault :: ConfigSource -> TraceConfig -> IO TraceConfig
- readConfigurationWithFallbackAndDefault :: SeverityS -> DetailLevel -> BackendConfig -> ConfigSource -> TraceConfig -> IO TraceConfig
- applyFallback :: SeverityS -> DetailLevel -> BackendConfig -> TraceConfig -> TraceConfig
- configToRepresentation :: TraceConfig -> ConfigRepresentation
Documentation
data ConfigSource Source #
The configuration source that should be ingested
Constructors
| FromFile FilePath | |
| FromJSONObject Object | |
| FromLazyBytes ByteString | |
| FromStrictBytes ByteString |
Instances
| Show ConfigSource Source # | |
Defined in Hermod.Tracing.ConfigurationParser | |
| Eq ConfigSource Source # | |
Defined in Hermod.Tracing.ConfigurationParser Methods (==) :: ConfigSource -> ConfigSource -> Bool Source # (/=) :: ConfigSource -> ConfigSource -> Bool Source # | |
mkConfiguration :: TraceConfig Source #
Creates the minimal viable configuration by only setting fallback values in an empty TraceConfig. Fallback options for the namespace root: Notice severity, normal detail, JSON stdout logging. Notice severity was chosen as it will never filter out any actionable traces while creating minimal noise in the log.
mkConfigurationWithFallback :: SeverityS -> DetailLevel -> BackendConfig -> TraceConfig Source #
Creates the minimal viable configuration by only setting custom fallback values in an empty TraceConfig. Fallback options for the namespace root: custom values.
readConfiguration :: ConfigSource -> IO TraceConfig Source #
Read a configuration source and return the internal representation. Fallback options for the namespace root: Notice severity, normal detail, JSON stdout logging.
readConfigurationWithFallback :: SeverityS -> DetailLevel -> BackendConfig -> ConfigSource -> IO TraceConfig Source #
Read a configuration source and return the internal representation. Fallback options for the namespace root: custom values.
readConfiguration' :: FilePath -> IO TraceConfig Source #
Read a configuration file and return the internal representation.
This will silently provide a minimal viable config via mkConfiguration when the file is absent.
Fallback options for the namespace root: Notice severity, normal detail, JSON stdout logging.
readConfigurationWithFallback' :: SeverityS -> DetailLevel -> BackendConfig -> FilePath -> IO TraceConfig Source #
Read a configuration file and return the internal representation.
This will silently provide a minimal viable config via mkConfigurationWithFallback when the file is absent.
Fallback options for the namespace root: custom values.
readConfigurationWithDefault :: ConfigSource -> TraceConfig -> IO TraceConfig Source #
Read a configuration source and return the internal representation.
TraceConfig fields not specified in the file will be taken from the provided defaultConf (when given there).
Fallback options for the namespace root: Notice severity, normal detail, JSON stdout logging.
readConfigurationWithFallbackAndDefault :: SeverityS -> DetailLevel -> BackendConfig -> ConfigSource -> TraceConfig -> IO TraceConfig Source #
Read a configuration source and return the internal representation.
TraceConfig fields not specified in the file will be taken from the provided defaultConf (when given there).
Fallback options for the namespace root: custom values.
applyFallback :: SeverityS -> DetailLevel -> BackendConfig -> TraceConfig -> TraceConfig Source #
Applies the fallback values to the namespace root, or creates a namespace root from them if none is present.
Furthermore, it ensures a metric prefix is properly namespaced, if there is one configured.
If you do not use any of mkConfiguration* or readConfiguration* to create your TraceConfig, but do it manually,
it is highly recommended to call applyFallback on that TraceConfig value as a last step before using it.
configToRepresentation :: TraceConfig -> ConfigRepresentation Source #
Convert config from internal to external representation
Orphan instances
| ToJSON TraceConfig Source # | |
Methods toJSON :: TraceConfig -> Value toEncoding :: TraceConfig -> Encoding toJSONList :: [TraceConfig] -> Value toEncodingList :: [TraceConfig] -> Encoding omitField :: TraceConfig -> Bool | |