projects
/
osm
/
MON.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Adds use of CustomCollector in Prometheus exporter
[osm/MON.git]
/
osm_mon
/
core
/
settings.py
diff --git
a/osm_mon/core/settings.py
b/osm_mon/core/settings.py
index
db78b4a
..
9700af5
100644
(file)
--- a/
osm_mon/core/settings.py
+++ b/
osm_mon/core/settings.py
@@
-64,6
+64,10
@@
class Config(object):
CfgParam('DATABASE', "sqlite:///mon_sqlite.db", six.text_type),
CfgParam('OS_NOTIFIER_URI', "http://localhost:8662", six.text_type),
CfgParam('OS_DEFAULT_GRANULARITY', "300", six.text_type),
CfgParam('DATABASE', "sqlite:///mon_sqlite.db", six.text_type),
CfgParam('OS_NOTIFIER_URI', "http://localhost:8662", six.text_type),
CfgParam('OS_DEFAULT_GRANULARITY', "300", six.text_type),
+ CfgParam('REQUEST_TIMEOUT', 10, int),
+ CfgParam('OSMMON_LOG_LEVEL', "INFO", six.text_type),
+ CfgParam('OSMMON_KAFKA_LOG_LEVEL', "WARN", six.text_type),
+ CfgParam('OSMMON_COLLECTOR_INTERVAL', 10, int),
]
_config_dict = {cfg.key: cfg for cfg in _configuration}
]
_config_dict = {cfg.key: cfg for cfg in _configuration}
@@
-73,12
+77,13
@@
class Config(object):
"""Set the default values."""
for cfg in self._configuration:
setattr(self, cfg.key, cfg.default)
"""Set the default values."""
for cfg in self._configuration:
setattr(self, cfg.key, cfg.default)
+ self.read_environ()
def read_environ(self):
"""Check the appropriate environment variables and update defaults."""
for key in self._config_keys:
try:
def read_environ(self):
"""Check the appropriate environment variables and update defaults."""
for key in self._config_keys:
try:
- val = s
tr
(os.environ[key])
+ val = s
elf._config_dict[key].data_type
(os.environ[key])
setattr(self, key, val)
except KeyError as exc:
log.debug("Environment variable not present: %s", exc)
setattr(self, key, val)
except KeyError as exc:
log.debug("Environment variable not present: %s", exc)