Helpers to handle HekaClient configuration details.
heka.config.
_convert
(value)[source]¶Converts a config value. Numeric integer strings are converted to integer values. ‘True-ish’ string values are converted to boolean True, ‘False-ish’ to boolean False. Any alphanumeric (plus underscore) value enclosed within ${dollar_sign_curly_braces} is assumed to represent an environment variable, and will be converted to the corresponding value provided by os.environ.
heka.config.
client_from_dict_config
(config, client=None)[source]¶Configure a heka client, fully configured w/ stream and plugins.
Parameters: |
|
---|
The configuration dict supports the following values:
All of the configuration values are optional, but failure to include a stream may result in a non-functional Heka client. Any unrecognized keys will be ignored.
Note that any top level config values starting with stream_ will be added to the stream config dictionary, overwriting any values that may already be set.
The stream configuration supports the following values:
heka.config.
client_from_stream_config
(stream, section, client=None)[source]¶Extract configuration data in INI format from a stream object (e.g. a file object) and use it to generate a Heka client. Config values will be sent through the _convert function for possible type conversion.
Parameters: |
|
---|
Note that all stream config options should be prefaced by “stream_”, e.g. “stream_class” should specify the dotted name of the stream class to use. Similarly all extension method settings should be prefaced by “extensions_”.
heka.config.
client_from_text_config
(text, section, client=None)[source]¶Extract configuration data in INI format from provided text and use it to configure a Heka client. Text is converted to a stream and passed on to client_from_stream_config.
Parameters: |
|
---|
heka.config.
dict_from_stream_config
(stream, section)[source]¶Parses configuration from a stream and converts it to a dictionary suitable for passing to client_from_dict_config.
Parameters: |
|
---|
heka.config.
nest_prefixes
(config_dict, prefixes=None, separator='_')[source]¶Iterates through the config_dict keys, looking for any starting w/ one of a specific set of prefixes, moving those into a single nested dictionary keyed by the prefix value.
Parameters: |
|
---|