Configuring the Gordon Service¶
Main module to run the Gordon service.
The service expects a gordon.toml
and/or a gordon-user.toml
file for configuration in the current working directory, or in a
provided root directory.
Any configuration defined in gordon-user.toml
overwrites those in
gordon.toml
.
Example:
$ python gordon/main.py
$ python gordon/main.py -c /etc/default/
$ python gordon/main.py --config-root /etc/default/
Example Configuration¶
An example of a gordon.toml
file:
# Gordon Core Config
[core]
plugins = ["foo.plugin"]
debug = false
metrics = "ffwd"
[core.route]
consume = "enrich"
enrich = "publish"
publish = "cleanup"
[core.logging]
level = "info"
handlers = ["syslog"]
fmt = "%(created)f %(levelno)d %(message)s"
date_fmt = "%Y-%m-%dT%H:%M:%S"
address = ["10.99.0.1", "514"]
# Plugin Config
["foo"]
# global config to the general "foo" package
bar = baz
["foo.plugin"]
# specific plugin config within "foo" package
baz = bla
You may choose to have a gordon-user.toml
file for development. All tables are deep merged into gordon.toml
, to limit the amount of config duplication needed. For example, you can override core.debug
without having to redeclare which plugins you’d like to run.
[core]
debug = true
[core.logging]
level = "debug"
handlers = ["stream"]
Supported Configuration¶
The following sections are supported:
core¶
-
plugins
=LIST-OF-STRINGS
¶ Plugins that the Gordon service needs to load. If a plugin is not listed, Gordon will skip it even if there’s configuration.
The strings must match the plugin’s config key. See the plugin’s documentation for config key names.
-
debug
=true|false
¶ Whether or not to run the Gordon service in
debug
mode.If
true
, Gordon will continue running even if installed & configured plugins can not be loaded. Plugin exceptions will be logged as warnings with tracebacks.If
false
, Gordon will exit out if it can’t load one or more plugins.
-
metrics
=STR
¶ The metrics provider to use. Depending on the provider, more configuration may be needed. See provider implementation for details.
core.logging¶
-
level
=info(default)|debug|warning|error|critical
¶ Any log level that is supported by the Python standard
logging
library.
-
handlers
=LIST-OF-STRINGS
¶ handlers
support any of the following handlers:stream
,syslog
, andstackdriver
. Multiple handlers are supported. Defaults tosyslog
if none are defined.Note
If
stackdriver
is selected,ulogger[stackdriver]
needs to be installed as its dependencies are not installed by default.
Other key-value pairs as supported by ulogger will be passed into the configured handlers. For example:
[core.logging]
level = "info"
handlers = ["syslog"]
address = ["10.99.0.1", "514"]
fmt = "%(created)f %(levelno)d %(message)s"
date_fmt = "%Y-%m-%dT%H:%M:%S"
core.route¶
A table of key-value pairs of phases used to indicate the route the a message should take. All keys should correspond to either the start_phase attribute of a runnable plugin or the phase of a message handling plugin. Values may only correspond to phase of a message handling plugin.
[core.route]
start_phase = "phase2"
phase2 = "phase3"