The repo is Python 3 now, so update hacking to version 3.0 which
supports Python 3.
Fix problems found.
Update local hacking checks for new flake8.
Change-Id: I6396403d0a62f5403fc5b7fb04b6ce790c332c84
Even though there was a py36 test enabled in the gate, the tox.ini
configuration was not actually invoking the unit tests. This
change sets up the environment to allow tests to run.
As a result, a number of Python3 errors are uncovered and fixed.
Notably:
Python 3 does not have contextlib.nested, so reformatting using ,
file() is not in Python 3, so use io.open() instead
Use six.assertCountEqual(self, in tests
safe_decode:
subprocess.check_output returns in byte encoding, while default text
type str. safe_decode does the right thing by making sure string are not
bytes in python2 and python3
No ascci encoding:
python3 defaults to UTF-8 encoding, which is merely an extension to
ascii (default for python2).
test_json_plugin.py:
the file being opened in binary(wb) mode so python is expecting the
string in bytes.
Some of the refactoring should be revisited after we drop Python 2
support.
Change-Id: I62b46a2509c39201ca015ca7c269b2ea70c376c8
Story: 2005047
Task: 29547
Use the six library to get monasca-agent to work with
python2.7 and python3.
Story: 2004148
Task: 27621
Change-Id: I0de315967dd5a745741fda0c53ce8cc85cda8cc5
Signed-off-by: Chuck Short <chucks@redhat.com>
We want to default to running all tox environments under python 3, so
set the basepython value in each environment.
We do not want to specify a minor version number, because we do not
want to have to update the file every time we upgrade python.
We do not want to set the override once in testenv, because that
breaks the more specific versions used in default environments like
py35 and py36.
Change-Id: I12967d5f5e707efe2b271b28bc7ea4b40e7f1c15
Observed AttributeError in forwarder and collector logs due to
missing import of logging module handlers.
Added missing import and removed module level import.
Task:15058
Story: 2001941
Change-Id: I62b03bb550c8b01ce9ea5bb4ba49a2ac00763d68
Observed TypeError in forwarder and collector logs while
executing monasca agent. Due to which monasca agent failed
to start.
Added line continuation character to fix the error.
Change-Id: Ibaf148ca6cf7b9cb73ceabacccf7aa519897af72
Task: 14449
Story: 2001922
* set the maximum line length to 100
* cleaned up the codes for pep8
Depends-On: https://review.openstack.org/560844
Change-Id: Id548b78b673cce869ef8291bdb6b4f1367b383ed
Signed-off-by: Jui Chandwaskar <jchandwaskar@op5.com>
The argument io_loop on the ioloop.PeriodicCallback constructor is
deprecated in newer tornado versions, so we can just remove it.
Since we are using tornado<=4.5.2 on stable/pike, we can correctly set
master's version to tornado>=4.5.3.
Story: 2001489
Task: 6218
Change-Id: Id621d5b609e1bf4eac3a3dd4aff44436dd012b87
In cadvisor and kubernetes plugin network metrics are reported
by individual network interface and disk io metrics are by each
device. Instead of getting seperate metrics for each interface
or device, the roll up results among all are more useful.
Change-Id: I483a7f458ce05de2572d8dfe70e5943eae572f3b
Currently, it only loads the conf.d folder based on
the statically defined default config file location.
It should take into account the config-file argument
passed.
The Config object already has a get_confd_path method
which does this, and it should be used instead.
Partially-Implements: blueprint add-windows-support
Change-Id: I406b1773920d0b546956452da5003b3f27de8bc0
Currently, the configurations are being loaded from a
statically defined file (/etc/monasca/agent/agent.yaml).
Adds CLI arg option for the configuration file (--config-file).
Also added this argument to the forwarder's tornado options, in
order to avoid exception due to unrecognised argument.
Co-Authored-By: Craig Bryant <craig.bryant@hpe.com>
Partially-Implements: blueprint add-windows-support
Change-Id: I400fdb3db6562a7171ecadcb27ee63ae4eaf8006
Adding the metrics to monitor resource pools, resources
and projections per a node.
Metrics for Vertica are now:
vertica.connection_status
vertica.node_status
vertica.projection.ros_count
vertica.projection.tuple_mover_mergeouts
vertica.projection.tuple_mover_moveouts
vertica.projection.wos_used_bytes
vertica.resource.disk_space_rejections
vertica.resource.pool.memory_inuse_kb
vertica.resource.pool.memory_size_actual_kb
vertica.resource.pool.rejection_count
vertica.resource.pool.running_query_count
vertica.resource.request_queue_depth
vertica.resource.resource_rejections
vertica.resource.wos_used_bytes
Change-Id: I6e30d524ca77f900f231b9a626bfa853e31dbeb1
Remove windows related code as we do not support running on
windows
Remove the idea of check status as it was added code and complexity
that we did not gain much from.
Remove some functions at the AgentCheck level that either added another
layer of complexity that we did not get any functionality from or functions
that we didnt use like events
Change-Id: I4b6bc4f9d38e6b4f4fe5c632f885b84aaff7fd08
The vertica plugin will watch vertica processes
(create process.pid_count metrics for vertica
processes) and create vertica.db.connection_status
metrics. A vertica.db.connection_status with
value=1 can indicate that the DB on a host
is not healthy.
Change-Id: I03dddec6adaa3f428fdabb5e24e884be1adb3dab
Restart the collector every 24 hours by default will
prevent the collection time growing over 15 seconds
Change-Id: I8e26ba703d13adaa685e397e9dbec749b2ed843d
Add collection time in millisecond for each check in log file (DEBUG).
If the collection time for a single check is larger than the threshold value
for warning (5second as default), a warning message will be created in log file.
Change-Id: Ieb4949fbdd6b3db79de13b52abe2a367afceaa9e
This change allows slightly more lenient processing of Agent config
files, where 'instances' is still required in the .yaml file, but may
be an empty list.
An example of where this is necessary is the libvirt plugin, where
it is unreasonable to have all VMs enumerated as 'instances' in the
.yaml file, but are instead provided by the hypervisor.
The libvirt plugin itself needed a minor modification to work with
empty instances. These changes are necessitated by the monasca-setup
change https://review.openstack.org/239815
Change-Id: Idc67df9e5d9195f65fe16b9d67478e1de8e61eb3
The watchdog is causing problems by restarting the agent
even if it does not need to. Also we are not gaining
anything by running it. In result we are removing
watchdog completely from the agent.
Change-Id: I45b80e28d81749c98dff7273d7756e10db23da70
Converted the config file to yaml and updated the config processing logic to match.
Cleaned up some deprecated config item processing.
Change-Id: I8c5d9ad841b22d20825608ac9f2c82d8011b04f0
Changed the IO, Disk and Network classes to not use a subprocess.
They now use psutil to get the metrics. Also, changed the linux
system metrics classes to subclass the AgentCheck class instead
of the old-style Check class. Added additional configuration
and changed monasca-setup to support that. Fixed some Python
2.6 incompatible string formatting issues.
Change-Id: I1f8b65bf48e48e2c598aa4950c194fbae2f9e337
Updated the plugin code to handle the dimensions from the agent config,
the plugin config and dimensions defined in the code correctly.
Also removed the old-style plugin configuration code from several of
the plugins and added a command-line option to monasca-setup to pass
the log_level if desired instead of hard-coding it in the config.
This will make it easier to test in debug mode. Fixed an issue
with the Swift detection plugin.
Change-Id: I679457e5e1f302b0cdc87b0f0f799a42a9fa0ba4
The command-line debugging tools "monasca-collector check check_name_here"
and "monasca-collector check_all" were hanging on the multi-threaded
ServicesCheck based agent checks. Added calls to stop the thread pool
after the checks ran. Removed duplicate code.
Change-Id: Iac033beafc1c055de13eba855819a881629ad55d
Fixed the service dimension for api checks on various openstack services
so that it matches that of the other service checks, allowing for it to
be grouped together.
Modified the config so a config in the working dir can be used this is
helpful for testing. Additionally I fixed up few tests and removed
some no longer used, there is a lot of work with test left unfinished
Change-Id: Ic5b127db41c174735f1436bb511f00e271274cb0
Reorganized and created classes for the methods in config.py.
Added more sections to the agent config file.
Moved a lot of functions out of config.py that were more
utility-like to util.py.
Change-Id: I19fc709fb165895382099b49fd9c83991ca1183d
The dimension handling was incorrect. It now follows this order of precedence:
1) Dimensions defined in a plugin config file
2) Dimensions that are defined in the agent config file
3) Dimensions that are defaults in a particular plugin
Also, updated imports to meet the OpenStack standards.
Change-Id: I99d82f2b534ca7b3bea8a147c83404505177e15e
Renamed monagent package to monasca_agent and monsetup package to monasca_setup.
Also, renamed the monstatsd agent package to statsd to more closely match the internal
collector and forwarder packages.
Change-Id: I0649ae4341fe325007e2a8d37161d330e4c95d72