Commit Graph

253 Commits

Author SHA1 Message Date
Jaromir Wysoglad d2e247cf38 Remove monasca
This removes the monasca integration. Monasca was recently
declared as inactive project. In addition the monasca related
unit tests were very verbose and they were outputing a lot
of errors. Lately one of the unittests even started failing
randomly.

Change-Id: I468079b2a790245bd682c80d0116fb0da60d0e7c
2023-11-08 04:30:36 -05:00
Erno Kuvaja 7cad2dc839 Add 'check_requirements' job to CI
Drops tenacity cap to align with global requirements.

Change-Id: Id3fbbc1844c0c94042c89544c10070176798263a
2023-05-05 14:07:13 +01:00
Zuul 934333f06c Merge "Add response handlers to support different response types" 2022-10-11 13:23:31 +00:00
Pedro Henrique 225f1cd776 Add response handlers to support different response types
Problem description
===================
The dynamic pollsters only support APIs that produce
JSON responses. Therefore the dynamic pollsters do not
support APIs where the response is an XML or not Restful
compliant APIs with HTTP 200 within a plain text message
on errors.

Proposal
========
To allow the dynamic pollsters to support other APIs
response formats, we propose to add a response handling
that supports multiple response types. It must be
configurable in the dynamic pollsters YAML. The default
continues to be JSON.

Change-Id: I4886cefe06eccac2dc24adbc2fad2166bcbfdd2c
2022-09-01 10:07:29 -03:00
Takashi Kajinami a28cef7036 Remove GenericHardwareDeclarativePollster
... and discovery/inspector plugins depending on the pollster. These
were implemented to gather metrics via SNMP daemon in TripleO-managed
deployment but these are no longer valid since Telemetry services and
Nova were removed from undercloud.

Change-Id: If9a6b695ba799c766314a88328ea8a779407acc0
2022-07-01 01:39:46 +09:00
Ghanshyam Mann 184161dc01 Drop lower-constraints.txt and its testing
As discussed in TC PTG[1] and TC resolution[2], we are
dropping the lower-constraints.txt file and its testing.
We will keep lower bounds in the requirements.txt file but
with a note that these are not tested lower bounds and we
try our best to keep them updated.

[1] https://etherpad.opendev.org/p/tc-zed-ptg#L326
[2] https://governance.openstack.org/tc/resolutions/20220414-drop-lower-constraints.html#proposal

Change-Id: I817e5112eb57df2e6192d3cfa681b7768832c77a
2022-05-01 13:13:12 -05:00
Matthias Runge 7a994d0719 Update requirements and lower_constraints
Also add the lower-constraints test to a more prominent place
in tox.

Change-Id: Ida5a27ef2af8536b91df23eb9af9ed4bdedcce4b
2021-10-12 10:20:19 +02:00
Zuul 14922b71d2 Merge "Ceilometer compute `retry_on_disconnect` using `no-wait`" 2021-06-30 10:38:29 +00:00
Zuul 8bdfea78ea Merge "Remove Xen support" 2021-06-02 17:42:14 +00:00
Jon Schlueter 4ae76f3152 remove requires on monotonic
monotonic dependency was removed when switching to python3.  The
requires on it is not needed. It was previously limited to python < 3.3
but that limit got lost.  There is no current usage in the code
importing monotonic.

https: //review.opendev.org/c/openstack/ceilometer/+/676706
Change-Id: I182dd641893eea7226a5e3afc17132ac973b516b
2021-05-27 12:26:48 -04:00
Takashi Kajinami 99bdd78d95 Remove Xen support
This change removes the Xen support which was deprecared during
the previous cycle[1].

[1] fd0a561bea

Change-Id: If1675468095cbc1b9c065edb6b086e7f4afa2f3e
2021-05-05 09:18:31 +00:00
Rafael Weingärtner b664d4ea01 Ceilometer compute `retry_on_disconnect` using `no-wait`
It was discovered a problem on a production setup of Ceilometer compute
with metrics stopping to be gathered. While troubleshooting, we found
the following error message.

```
ERROR ceilometer.polling.manager [-] Prevent pollster cpu from polling
```

That error message happened after the following message:

```
WARNING ceilometer.compute.pollsters [-] Cannot inspect data of
CPUPollster for <UUID>, non-fatal reason: Failed to inspect instance
<UUID> stats, can not get info from libvirt: Unable to read from
monitor: Connection reset by peer: NoDataException: Failed to inspect
instance <UUID> stats, can not get info from libvirt: Unable to read
from monitor: Connection reset by peer
```

The instance was running just fine in the host. It seems a concurrency
issue with some other process that made the instance locked/unavailable
to ceilometer computer pollsters. Ceilometer was unable to connect to
Libvirt (after 2 retries), and the code is designed to prevent
Ceilometer from continuing trying. Therefore, the "CPU" metric pollster
was put in permanent error. To fix the issue, We needed to restart
Ceilometer in the affected hosts. However, until we discovered this
issue, we lost the amount 3 days of data.

```
@libvirt_utils.raise_nodata_if_unsupported
@libvirt_utils.retry_on_disconnect
def inspect_instance(self, instance, duration=None):
    domain = self._get_domain_not_shut_off_or_raise(instance)
```

It will try to retrieve the domain (VM) object (XML description) via
libvirt. If it fails, it will retry via
`@libvirt_utils.retry_on_disconnect`; if that fails, it marks the
metric in permanent error with the annotation:
`@libvirt_utils.raise_nodata_if_unsupported`.

Other metrics continued working. Therefore, I investigated a bit
deeper, and the problem seems to be here:

```
retry_on_disconnect = tenacity.retry(
    retry=tenacity.retry_if_exception(is_disconnection_exception),
    stop=tenacity.stop_after_attempt(2))
```

The `retry_on_disconnect`  annotation is not configuring the "tenacity"
retry library wait. The default is "no wait". Therefore, the retries
have a bigger chance of being affected by very minor instabilities
(microseconds connection issues can generate a problem with this
configuration). One alternative to avoid such problems in the future
is to use a wait configuration such as the one being proposed. Then,
ceilometer computer pollsters would wait/sleep before retrying, which
would provide some time for the system to be available for the compute
pollsters.

In this proposal, we would wait 2^x * 3 seconds between each retry
starting with 1 second, then up to 60 seconds.

Change-Id: I9a2d46f870dc2d2791a7763177773dc0cf8aed9d
2021-05-04 15:34:21 -03:00
Matthias Runge 26f5ceca03 Use tox constraints instead of upper constraints
Drop cap on tenacity, since it is already capped
by upper constraints.

Make grenade jobs non-voting, until they have been fixed.

Depends-on: https://review.opendev.org/c/openstack/telemetry-tempest-plugin/+/787739

Change-Id: Ie21f8db89fc2045fd6cc6b1b7a5886b7e87e08e2
2021-04-26 06:56:28 +00:00
Matthias Runge e7abc7070e Cap tenacity < 7.0.0
https://github.com/jd/tenacity/pull/274/files removed code
which was still in use.

Change-Id: I8ac6684d9f03a48cc5dd3d712cbd2868b34e1013
2021-03-22 09:16:22 +01:00
kuangcx c0632ae9e0 Replace six with python3 code style
Co-authored by: Matthias Runge <mrunge@redhat.com>

Change-Id: I85a4d79396874670f1b36cb91cfba5da812c2839
2021-01-13 14:20:31 +01:00
Matthias Runge c6f04f772c Fix lower-constraints job
Change-Id: I5a7c087b29f3b0d7d9f63c2a774b8f2aff35b7a3
2020-12-14 16:02:30 +01:00
Ghanshyam Mann c11bf9136d [goal] Migrate tox based testing to ubuntu focal
As per victoria cycle testing runtime and community goal[1]
we need to migrate upstream CI/CD to Ubuntu Focal(20.04).

Fixing:
- bug#1886298
Bump the lower constraints for required deps which added python3.8 support
in their later version.

Story: #2007865
Task: #40223

Change-Id: I1f8577e560fd3ffad0c3b6edfc4c74dddedfa719
2020-09-10 22:54:46 +00:00
zhurong bc9ef4a2a4 Cleanup py27 support
Make a few cleanups:
- Remove python 2.7 stanza from setup.py
- Add requires on python >= 3.6 to setup.cfg so that pypi and pip
  know about the requirement
- Remove obsolete sections from setup.cfg:
  * Wheel is not needed for python 3 only repo
  * Some other sections are obsolete
- Update classifiers
- Update requirements, no need for python_version anymore

Change-Id: I93294c42a967ca19b9b04ead9cd636b52f1cc038
2020-04-11 00:57:21 -07:00
Ghanshyam Mann c639578217 [ussuri][goal] Drop python 2.7 support and testing
OpenStack is dropping the py2.7 support in ussuri cycle.

ceilometer is ready with python 3 and ok to drop the
python 2.7 support.

Complete discussion & schedule can be found in
- http://lists.openstack.org/pipermail/openstack-discuss/2019-October/010142.html
- https://etherpad.openstack.org/p/drop-python2-support

Ussuri Communtiy-wide goal:
https://governance.openstack.org/tc/goals/selected/ussuri/drop-py27.html

Depends-On: https://review.opendev.org/#/c/693631/

Change-Id: Ie8523712ea2ebe828fe01a649b6add90e813608b
2019-11-26 11:54:50 +00:00
Zuul f372d9ae8e Merge "publisher: Contribute the Monasca publisher" 2019-11-01 04:19:26 +00:00
Joseph Davis 126350c0ae publisher: Contribute the Monasca publisher
The Ceilosca (monasca-ceilometer) publisher has been around since
before the Mitaka release and has been used in production for years.
The MonascaPublisher acts as another Ceilometer publisher and sends
selected metrics on to the Monasca API for storage, aggregation,
alarming, etc.  Once metrics are in Monasca, they may be retrieved
through the Monasca API or with the python-monascaclient. This
Ceilosca functionality is a key component for metering in several
distributions and is used in many customer installations.

With the removal of the Ceilometer v2 API (which allowed the
removal of the Ceilosca storage driver, shrinking the Ceilosca
code base) and continuing changes to Ceilometer, a tighter
integration with the ceilometer repo may be beneficial to keep
both Monasca and Telemetry in sync.

Change-Id: I2cbce160503e23dfbde375722a3bd100ec86494e
Story: 2001239
Task: 5769
2019-10-07 19:47:53 +02:00
Jon Schlueter 6c0a982788 Only install monotonic on python2
monotonic is a backport of time.monotonic from python3. Only install it
for python2.

Depends-On: https://review.openstack.org/615441
Change-Id: Id27cd748e883d54dd93dac2e6bd8caee6728f7e1
2019-08-23 14:39:54 +00:00
akhiljain23 53321c1a72 Add framework for ceilometer-status upgrade check
This commit adds the functionality of ceilometer-status CLI for performing
upgrade checks as part of the Stein cycle upgrade-checkers goal.
It only includes a sample check which must be replaced by real checks in
future.

Change-Id: I6e76b74b2f02251ee39025e02de44b13568ebed2
Story: 2003657
Task: 27732
2019-05-16 11:13:43 +08:00
zhurong bd0d5a8a27 Switch to oslo privsep
Please reference here:
https://docs.openstack.org/oslo.privsep/latest/user/index.html#converting-from-rootwrap-to-privsep

Change-Id: I5db0e64ec38d912f907b4ad483562120d030d726
2019-04-28 11:09:05 +08:00
zhurong 4274f13932 Add lower-constraints job
Change-Id: Ib2524bbdcba4a50b3119a59e0879636399c5c89f
2019-04-25 10:09:04 +08:00
ZhongShengping a626f315f1 Fix install_command in tox.ini
Co-Authored-By: zhurong <aaronzhu1121@gmail.com>
Change-Id: Ib727161e05e1a837c5a1a0a968b2488ec9815eca
2019-04-22 19:57:34 +08:00
Elod Illes e4997a4ccf Skip oslo.messaging 9.0.0 release
With oslo.messaging 9.0.0 the ceilometer tests are failing. A fix [1]
in oslo.messaging already proposed and merged, but a release is needed
for the ceilometer tests to pass.

[1] https://review.openstack.org/#/c/608196/

Change-Id: Ia90e4fb28c42467a9090d53742b5acc9d4841aaa
2018-10-09 11:21:36 +02:00
Julien Danjou 3d0b481339 event: remove deprecated method
Change-Id: Iadda5e51d61c44c4dd11d7fc82bc7938f74baa5c
2018-09-18 11:09:06 +02:00
Julien Danjou 4e4459d57a Add support for Python 3.7
Change-Id: I3b880cbf1de13d61d557cde2be70a1efe07761ba
2018-07-18 09:25:09 +02:00
Mehdi Abaakouk 0fce8e48a3 publisher: allow to not inherit from ConfigPublisherBase
Change-Id: I9bb2f392bcdd5d920a8f0db883766e5439d7de73
2018-07-17 13:33:41 +00:00
Thomas Bechtold 2452958be4 Use msgpack instead of msgpack-python
msgpack-python got renamed to msgpack (see
https://pypi.python.org/pypi/msgpack-python/0.5.1) and msgpack-python
is deprecated now.
This is important because other requirements already switched to
msgpack (eg. oslo.serialization) and installing both in parallel is
not possible for Distros.

Change-Id: I603eadbc2a5e1705375050920d5f1631c51a5a02
Closes-Bug: #1743445
2018-02-08 07:25:41 +01:00
James Page 05050e4b21 Replace ujson with json
ujson has not had any active maintenance for the last 12 months;
switch to using json module instead.

Change-Id: I39027b534e94b3f877d881647a7c843183f60f92
Closes-Bug: 1737989
2018-01-03 13:54:27 +00:00
gord chung a7253a8387 remove kafka and keystonemiddleware reqs
- no more api
- no more kafka publisher (use oslo.messaging)

Change-Id: I21794db25b624049df21d076ebe3be88fcd9d95a
2017-10-30 19:06:38 +00:00
Julien Danjou 7b959b33c5 Replace jsonutils by ujson
ujson is faster than jsonutils, and we do not need any fancy feature jsonutils
might offer.

This also has the benefit of removing a big dependency on Ceilometer.

Change-Id: I24bf08d0fa6ccc34beef0a0c34a47bf2fa266e3e
2017-10-26 09:35:14 +02:00
Julien Danjou 9323f07f97 Remove deprecated storage drivers
Change-Id: I6b262dd440a72f25662b64d938ab9e5328709a97
2017-10-26 09:35:14 +02:00
Julien Danjou d881dd5228 Remove Ceilometer API
This removes the deprecated Ceilometer API.

Change-Id: I752b36b3dfe8f935b68c4d3d59ccb5b8b60c582f
2017-10-25 14:38:43 +02:00
Mehdi Abaakouk 75e10b2a48 High precision rate of change timedelta
The current way to calculate rate of change is not precise at all and
depends on the local host clock. So, we have good chance that the host
clock derive a bit between each polling. Also the timestamp is polling
cycle run and not the exact polled sample.

This makes the rate of change transformer not accurate, and maybe wrong
if the local clock have jumped to much or if a pollster make to much
time to get the stats (libvirt reconnection, ...).

A sample gets a new attribute monotonic_time, where we can store an
accurate polling time using monotonic.monotonic().

In rate of change transformer, if the monotonic time is available we use
to calculate the time delta between samples.

For instance metrics, we set monotonic_time as soon as we poll it from
libvirt, avoiding almost all precision issue.

That makes the rate of change precise to the nanoseconds for polled
samples, while keeping the timestamp identical for all samples polled
during one cycle.

Related-bug: #1527620
Change-Id: I40e14fb6aa595a86df9767be5758f52b7ceafc8f
2017-07-20 16:45:20 +02:00
Huan Xie f2279a6222 XenAPI: use os-xenapi for XenAPI driver
os-xenapi contains all XenServer dom0 plugins and provide utility
tools for communicating to XenServer dom0 plugins, currently both
nova and neutron projects are using os-xenapi. This patch is to
change ceilometer to use os-xenapi too.

Change-Id: I14819fd57305edb0f4337af88e56ed6b980d7da8
2017-05-10 18:19:59 -07:00
alextricity25 66a77bb64a Remove upper constraint on sqlalchemy
To comply with the upper-constraints defined in OpenStack
Requirements, the upper constraint for sqlalchemy has been
removed

Change-Id: Icb48c61b9022216a9593cdf20bb6166cb742fe56
Closes-Bug: #1687641
2017-05-02 10:04:42 -05:00
Jenkins 1a61747f87 Merge "Use HostAddressOpt for opts that accept IP and hostnames" 2017-03-23 19:24:42 +00:00
blue55 3b450c65dd Use HostAddressOpt for opts that accept IP and hostnames
Some configuration options were accepting both IP addresses
and hostnames. Since there was no specific OSLO opt type to
support this, we were using "StrOpt". The change [1] that added
support for "HostAddressOpt" type was merged in Ocata and became
available for use with oslo version 3.22.

This patch changes the opt type of configuration options to use
this more relevant opt type - HostAddressOpt.

[1] I77bdb64b7e6e56ce761d76696bc4448a9bd325eb

Change-Id: I2463fc873bb149cafa802f5743d5f482f25552fc
2017-03-23 14:42:54 +08:00
Jenkins 935e5f3112 Merge "coordination: create coordinator at init time" 2017-03-20 16:43:33 +00:00
Eric Berglund 3d965eee45 Remove second tenacity in requirements
tenacity is defined twice in requirements.txt for ceilometer. This
removes the definition with the lower requirement.

Change-Id: I9c94c4950e81223a73e0514e03697cdca562c28d
Closes-Bug: #1673798
2017-03-17 14:52:03 +00:00
Julien Danjou 5e43dc7733 coordination: create coordinator at init time
This also switches the coordination to zake:// in test so the code actually
works like it would with a production-ready coordinator.

Change-Id: I38f6a3389f70bed6b45fa7526a13d0484bfc9c3f
2017-03-17 11:24:29 +01:00
Mehdi Abaakouk 66179f89a0 libvirt: rewrite the error handling
Error handling of libvirt driver work 'sometimes'.
Some error are catched only with we lookup for a instance
uuid, but not for other libvirt operation.

This change rewrites the logic to catch libvirt error on
each inpector method. This ensures we catch all errors whatever
which libvirt method raises it.

We also leverage tenacity instead of the custom retry code.

Change-Id: Idd54c18ece42c2dce3baf82626d30d5c2e5a49d6
2017-03-16 17:54:25 +01:00
Darren Hague 01ce7ff89e Bump kafka-python and oslo.messaging
kafka-python is bumped to 1.3.2 in order to support Kafka 0.10.x
oslo.messaging is bumped to 5.12.0 in order to support kafka-python (there is
a changed parameter name that causes a stacktrace otherwise)

Change-Id: I630b999a050d7186d8c5fb38a24034a7f063c24b
2017-03-10 14:47:29 +00:00
gord chung b530fc3ec8 use tooz hashring
tooz provides hashring functionality so let's avoid duplicating it
since we already use tooz

Change-Id: Id40e4836c5690d252ba0830f6173587f8d5d470c
2017-03-03 19:04:31 +00:00
Mehdi Abaakouk b692d3a6a6 Don't poll nova with compute agent
This change introduces a new method to get instances
metadata on the ceilometer-compute-agent.

This switches devstack/gate to libvirt_metadata for gnocchi

Change-Id: Ice1918659be49589a45d7a406044adc0a187aa27
2017-01-09 15:41:37 +00:00
Alfredo Moralejo cf92a7a9d5 Bump minimal version of cotyledon
https://review.openstack.org/#/c/387193/ introduced import of
cotyledon.oslo_config_glue wich was introduced in release 1.3.0, so
we should require at least this version.

Change-Id: Icd8cd0e36266d824f3a0233106781739f7c36f4b
2016-12-01 13:53:53 +01:00
gord chung 380bb26dbb Replace retrying with tenacity
We are replacing all usages of the 'retrying' package with
'tenacity' as the author of retrying is not actively maintaining
the project. Tenacity is a fork of retrying, but has improved the
interface and extensibility (see [1] for more details). Our end
goal here is removing the retrying package from our requirements.

Tenacity provides the same functionality as retrying, but has the
following major differences to account for:
- tenacity uses seconds rather than ms as retrying did.
- tenacity has different kwargs for the decorator and
Retrying class itself.
- tenacity has a different approach for retrying args by
using classes for its stop/wait/retry kwargs.
- By default tenacity raises a RetryError if a retried callable
times out; retrying raises the last exception from the callable.
Tenacity provides backwards compatibility here by offering
the 'reraise' kwarg.
- tenacity defines 'time.sleep' as a default value for a kwarg.
That said consumers who need to mock patch time.sleep
need to account for this via mocking of time.sleep before
tenacity is imported.

This patch updates all usages of retrying with tenacity.
Unit tests will be added where applicable.

Note: This change is not newton critical so projects are welcome
to hold off on committing until post-newton. Ideally this change
will merge by the first part of Ocata so dependant functionality
can land and have time to solidify for Ocata.

[1] https://github.com/jd/tenacity

Closes-Bug: #1635394
Change-Id: I0ad7deee3f17f6626708369371167184a40e6368
2016-11-17 10:53:49 +00:00