Commit Graph

51 Commits

Author SHA1 Message Date
Gabriel Adrian Samfira dcbebab56c
Add missing region setting in service_credentials
This change adds the missing region setting in service_credentials. In a
shared keystone multi region setup, this setting is mandatory in order
for ceilometer to properly find the services it relies upon from the
same region it resides in. Without this setting, the ceilometer-upgrade
action will fail (along with any other calls made to ceilometer) if the
first endpoint returned by keystone is from a different region.

Change-Id: Ie14df0f5fc7ee18072091dbdb3ada817615a6670
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2024-01-05 17:59:18 +02:00
Arif Ali f046895cdb Revert "Add meter-sink as an option"
This reverts commit 6ed691807d.

The meter_sink is actually required in pipeline.yaml and not in
event_pipline.yaml, and this is something that needs to be enabled
for newton and above as the ceilometer-collector is not the
dependancy for this.

Change-Id: Ie40a99281f1f60de7a409e1e3a2025a850a8a446
2021-11-05 11:27:02 +01:00
Arif Ali f4d772e6a3
Enable pipeline_yaml for mitaka and above
This configuration for pipeline.yaml is still valid for mitaka and
above, so adding this in.

The ceilometer-collector package is not available in newer openstack
releases, so basing this on QUEENS_SERVICES.

This should solve the custom requirement of pipeline moving forward.

Other fixes:
* Update test-requirements.txt for cffi and related pins.
* Update focal-xena bundle to fix memcached series bionic requirement.

Closes-Bug: 1938807
Change-Id: I1946b6f172cdae6f444d07999d5e54d4e11a450e
2021-11-03 13:49:49 +00:00
Arif Ali 6ed691807d
Add meter-sink as an option
If the user wants to add a meter-sink to the pipeline.yaml
at the moment this cannot be done. Previously, pipeline-yaml
config option was allowed and could replace the whole config.

This will now allow to also add meter-sink as an option to
the event_pipeline.yaml, and allow a new source of collecting
all meters, and pushing to the value of meter-sink URLs.

Closes-Bug: 1938807
Change-Id: If6cd82e4153b29c1d8fdb6df150d0d4bb11d4e49
2021-08-12 10:23:38 +01:00
Zuul 4f63dbfa6a Merge "Add polling-batch-size config option" 2020-09-17 08:12:03 +00:00
Liam Young e3982a2d98 Fix restart when endpoint notification is received
Restarts were configured only when the ceilometer agent endpoint
had changed and only alarm services were triggered to be restarted.
This change adds a check for the gnocchi service having changed
too and restarts all services to be on the safe side.

Closes-Bug: #1867924
Change-Id: I48e2f079e2db640d485bc74bfc2cedfd7e82ac84
2020-08-20 09:17:58 +00:00
Rodrigo Barbieri 740cac6571 Add polling-batch-size config option
Samples collected can be batched together,
consequently increasing or reducing the
amount of API calls and body data
sent to the configured publisher.

This config is available since Rocky,
adding the config option to allow its
tuning.

Change-Id: I0e3f756aa0305d3a96e21c7498d6a56208c51007
Closes-bug: #1885190
2020-08-19 18:04:53 +00:00
Erlon R. Cruz de2056f4bf Fix python3 message error
This exception handling code was still calling for
'e.message' which is only present in Python 2 and
not supported anymore. Also fixed unit tests where were
skipping over this.

Closes-bug: #1886874
Change-Id: Ia541e7b8994fae56e04771333009321cd6ac164e
2020-07-10 08:55:20 +00:00
Edward Hope-Morley 2fad29a5ae Ensure agent restart on event_publisher.yaml change
Change-Id: I68bb146399fff4a93cb82701111d73b07a4c1a0b
Closes-Bug: #1880255
2020-07-03 16:54:16 +01:00
Stamatis Katsaounis b66b79378c Update ceilometer-upgrade action
This patch adds debug option to ceilometer-upgrade to be more
explanatory in case of failure. Furthermore, it adds the option of a
sane number of retries because in case of failure at the current
master branch the ceilometer-upgrade action hangs forever.

Change-Id: Ib992eea42c4b085387b19b92798bc88ef0e1589e
Signed-off-by: Stamatis Katsaounis <katsaouniss@gmail.com>
2019-10-24 08:14:39 +00:00
Alex Kavanagh 7cc006d262 Convert charm to Python 3
Change-Id: Id2a87f639619ecbdc9e02960e9530133c6816f78
2019-04-24 13:53:55 +01:00
David Ames 0a59a19ad2 Use leader set for ceilometer-upgrade checks
The previous attempt at addressing Bug#1811108 was a bit naive.
It was not HA aware and it failed to handle upgrade-charm.

This change moves from kv to leader-set as only the leader needs to run
the action and then inform the other nodes.

Note: on upgrade-charm we must assume the deployment has run
ceilometer-upgrade as there is no mechanism to determine this
independently. If we do not do this, the charm is in blocked state after
charm-upgrade. A warning is logged that this assumption has occurred.

Partial-Bug: #1811108
Change-Id: Idcc26df53542e78f0671942c99edfcbf61eccf6c
2019-02-07 20:23:02 +00:00
Zuul d6e5fd3b04 Merge "Make event_sink publisher configurable" 2019-02-07 10:47:53 +00:00
Edward Hope-Morley d398cdff36 Make event_sink publisher configurable
The charm currently configures events to be published to
rabbit on both the config.event_topic (event.sample queue)
and alarm topic but as of Queens Ceilometer no longer
consumes event.sample. This patch makes the event_sink
publishers configurable and defaults to publishing to
aodh to retain backwards compatibility.

Change-Id: I5b55f31adcf2b069ff51e387a416f9f1ac4099f8
Partial-Bug: #1676586
2019-02-07 10:09:48 +00:00
David Ames e2ca8f06de Status blocked until ceilometer-upgrade action
Currently it is unclear that ceilometer is not actually ready when it
is related to gnocchi until the ceilometer-upgrade action has run. The
status will show active Unit is ready when it is not.

When gnocchi is related, check that the ceilometer-upgrade action has
been run. If not set workload status to prompt the administator to run
the action.

Please merge the charm-helpers change first:
https://github.com/juju/charm-helpers/pull/270

Partial-Bug: #1811108
Change-Id: Id778ed3f59e4bcde9c6586aad46be2b5b9ccb531
2019-01-29 23:59:57 +00:00
Xav Paice 2baf36f4ee Add polling.yaml to managed configs
This change adds polling.yaml to the list of managed config files, for
Queens and above.  Two new config items are added alongside the
template, to take into account a choice between the two polling.yaml
files supplied with the Ceilometer source, one which has a small list of
pollsters and the other which has all pollsters.  Additionally the
change adds the option to set the polling interval.

Change-Id: Ifff72870cf79bea23dbd21586857dd832c9e1405
Closes-Bug: 1785933
Closes-Bug: 1652848
2018-11-30 15:01:22 +13:00
Liam Young 8cde93e515 Purge old packages on upgrade-charm
On charm upgrade the charm may switch to py3 packages. If so, ensure
the old py2 packages are purged. If the purge occurs then restart
services.

Change-Id: I23812e518d5d0ba64dff33ac8d704b8b0f829b7e
Closes-Bug: 1803451
2018-11-15 13:57:21 +00:00
Liam Young 67b149f89c Support listening to multiple rabbit queues.
This change adds the ability to listen for events across multiple
rabbit queues. Nova cells v2 has a message broker per cell and
the charms already support having a separate message broker for
neutron, in both these topologies ceilometer needs the ability to
listen to multiple brokers.

To achieve this a new relation 'amqp-listener' has been introduced.
The existing 'amqp' relation should be used for the broker that
ceilometer listens to and publishes to. 'amqp-listener' should be
used for additional brokers that ceilometer just listens on.

Update functional tests to satisfy relation with
nova-cloud-controller.

Change-Id: Ifdade3f7814620f4cd4a1d35a584cbc099bb6d88
2018-10-19 07:30:12 +00:00
Felipe Reyes 6d66394482 Add config to manipulate the pipeline.yaml
The configuration file /etc/ceilometer/pipeline.yaml will be managed by
juju, currently it is not. On every change of this file
ceilometer-collector daemon is restarted.

Change-Id: Ie18a5284812f4f698b929b9e17b34289e7732bf7
Closes-Bug: 1715672
2018-09-26 15:27:41 +00:00
Corey Bryant 7cee61a193 py3: Switch to using Python 3 for rocky or later
Switch package install to Python 3 for OpenStack Rocky or later.

When upgrading, remove any python-* packages that where explicitly
installated and then autoremove --purge any dependencies that are
no longer required.

Change-Id: I120ed44988f9e86a27f464dc879acdc1b8926dd8
2018-09-19 12:54:22 +00:00
Liam Young b64e500f6c Register pipeline conf in quuens+
A bug was causing the events yaml from being rendered on quuens+
deploys. This change adds it to the quuens+ configs.

Closes-Bug: 1773355
Change-Id: I309107da609e186638332d3a9bca00a86ccd6010
2018-05-30 08:13:39 +00:00
Zuul 1cd0316ec0 Merge "Add support for remote consumers of Ceilometer event data." 2018-05-09 16:21:54 +00:00
David Ames 7589f3c260 Do not assume OS release
The ceilometer charm was assuming grizzly before the ceilometer-common
package was installed to determine the OS release. On queens deploys
this breaks due packages not being installed.

If ceilomter-common is not installed return empty configs.

Change-Id: Ib8bc1b7be3595bd8e64a25d0444dd768b80de881
Closes-Bug: #1759301
2018-05-08 09:11:38 -07:00
Michael Skalka 668a289862 Add support for remote consumers of Ceilometer event data.
There is a use-case to forward events received by ceilometer from
OpenStack services to an external system via http/udp. It comes
from the fact that aodh does not include all information about an
event alarm into POSTed data. Raw event data can be published by
ceilometer via http/udp to an external system without giving a
user direct access to rabbitmq.

This patch adds a context generator, associated templates, and
configuration entry for configuring multiple event-sinks in
/etc/ceilometer/event_pipeline.yaml. This also modifies the
ceilometer.conf templates to reflect the correct naming of the
same file to align with upstream Ceilometer.

Also adds support for a future Panko charm event consumer using
the event-service interface in the above context with associated
metadata and hook symlinks.

This change will only effect Mitaka and later clouds.

Closes Bug: 1763321

Change-Id: I931438c720272bd9a3d2b958ebabcd3584790bd0
2018-05-08 09:50:36 -04:00
David Ames f3148b9bd7 Run ceilometer-upgrade as an action
The ceilometer-upgrade command needs to be run to update back end
ceilometer data stores. When attempting to run this command during
deploy time due to the number of required relations many inherent
race conditions exist leading to Bug#1749280.

This change allows the ceilometer-upgrade command to be run as an action
post-deploy.

Change-Id: I64a56d9a38532476b8a01df6227231a1276c708f
Closes-Bug: #1749280
2018-03-08 14:20:15 +00:00
Zuul 338a48b09a Merge "Do not complete MongoDBContext with out replset" 2018-03-01 07:06:12 +00:00
David Ames 4eec1929c5 Do not complete MongoDBContext with out replset
When there are multiple mongodb peers but replset has not yet been set
on the relation, do not complete the MongoDBContext. This causes the
template to be rendered incorrectly and leads to the following error:

ERROR ceilometer ValueError: Port must be an integer between 0 and
65535:

Closes-Bug: #1750639
Change-Id: Ifb9424ac5e175d788fa21de0ee332c0a13e61a9f
2018-02-24 13:11:53 -08:00
David Ames bc64054066 Delay between retries on ceilometer-upgrade
Ceilometer-upgrade is in a race with the keystone catalog for the
metric entry. The function already has a retry on error loop. Bump up
the delay between retries to mitigate the race with keystone.

Change-Id: I7fdf36a1cf480607744dcfed9628f0bf9e6daac0
2018-02-23 08:50:58 -08:00
Zuul 36bfb3028b Merge "Align worker configuration option" 2018-02-21 18:19:44 +00:00
James Page b7a329d456 Align worker configuration option
Align ceilometer charm with worker-multiplier usage as found
across the majority of OpenStack Charms.  Worker configuration
values are set for API, Notification and Collector services
as needed for each release. Note that for Ocata or later, API
services are executed as WSGI apps under Apache which was
already plugged into the standard worker calculation logic
in charm helpers.

This includes dropping of the existing api-worker configuration
option in preference to a calculated approach.

Change-Id: Idba7c3012d9d24b7ae6ef8eade4a5261ef1cbddc
Closes-Bug: #1745189
2018-02-20 13:29:55 +00:00
Billy Olsen 4727842bfb Sync charm-helpers
Sync charm-helpers to pick up the updated InternalEndpointsContext
which removes the need to provide a package.

This essentially reverts commit f76d0755 in favor of an alternative
approach to selecting the volume catalog endpoint information.

Change-Id: I4a985fe1b8885b14aefdfeda9a8c2c4914c5fc93
Related-Bug: #1733566
2018-02-08 18:21:13 -07:00
James Page 4c450fed8c Add support for OpenStack Queens.
Update charm to support Ceilometer@Queens; specifically:

 - Removal of Ceilometer API service
 - Removal of ceilometer-collector service

Most of this change is related to dropping of these
services; In addition its now possible to complete a
ceilometer-upgrade without mongodb being configured.

As this charm no longer provides any endpoints to
keystone, for Queens the identity-credentials relation
is required instead of the identity-service relation.

Change-Id: I3cefc24ffc9a0e60f446fbbdff603dfad37f7baa
2018-01-03 10:40:29 +00:00
Edward Hope-Morley f76d075570 Sync ch and update InternalEndpointContext
Change-Id: Ie361b9a43a6a45b3c3fcd8ac87fdfaad599b2639
Partial-Bug: 1733566
2017-12-08 10:14:36 +00:00
James Page f778d87ca8 Reset os_release cache during upgrade
Ensure that the os_release cache is cleared during the openstack
upgrade process, ensuring that package list and configuration
options are correctly set for the new OpenStack version.

Change-Id: Ie685854952527f59ee344bfda8e49250c248150a
Closes-Bug: 1715624
2017-09-07 16:55:39 +01:00
James Page 669bc22be9 Add support for use-internal-endpoints
Add support for use of internal endpoints for inter-service
API calls from ceilometer.

Change-Id: Id702de85fb2236f21773ee7f2fb3698012b5f16c
Closes-Bug: 1713923
2017-09-05 11:46:26 +01:00
James Page 72522a341f Add support for gnocchi
Add new metric-service interface to support use of
Gnocchi as a storage backend for resource and metric
data.

Configure ceilometer to use the gnocchi dispatcher
in the event that ceilometer is related to gnocchi.
This has the side effect of disabling the ceilometer
API - Aodh and Gnocchi API's should be used directly
in this deployment topology.

Note that Gnocchi is only supported in OpenStack
Mitaka or later; 'metrics-service' is added to the
required interfaces configuration as an alternative
to 'mongodb' for >= Mitaka.

Change-Id: Ia31dfefd5efa3fb5ec2ba5d132ee865c567bd8df
2017-08-10 12:57:42 +01:00
Jenkins cf70a3ab26 Merge "Cast time-to-live values to int" 2017-05-15 13:21:42 +00:00
Alex Kavanagh 628b106f12 Fix alphanumeric comparisons for openstack and ubuntu releases
- sync charmhelpers with fix-alpha helpers
- fix up code where the alpha comparisons are done
- fix tests which assumed mocks would just work on os_release()

Change-Id: I3d142f04bedc7dde12f3c079534cd43841fa8401
Related-Bug: #1659575
2017-04-26 16:39:26 +01:00
Billy Olsen 09bb38e488 Cast time-to-live values to int
For large integer values, Juju can choose to return the number
in scientific notation. This causes the python code loading the
config data to return a floating point number instead of an
integer. Floating point values in ceilometer's configuration file
will prevent ceilometer from starting.

This change forces the type to an integer, allowing users to
specify large ttl values.

Change-Id: I8e29e6868b4c4a4ae20ad87ab585508fd321261c
Closes-Bug: #1651645
2017-04-13 17:47:43 -07:00
David Ames 5951cbb763 Stop checking for ceilometer-agent-central service
Since Liberty ceilometer-agent-central has been replaced with
ceilometer-polling. There is some confusion there as the package
is still named ceilometer-agent-central.

For OpenStack releases >= Liberty stop checking for the
ceilometer-agent-central service to be running.

TODO for post release: remove the OCF management of the service(s).

Change-Id: I5064ce130da1ec302245aaff5dbe93d9dab63b38
Partial-bug: #1664898
2017-02-17 09:27:29 -08:00
Corey Bryant 47ef4a4684 Run ceilometer-api under mod_wsgi with apache2
This change aligns with the Ocata ceilometer package, which has
moved the ceilometer-api to run under mod_wsgi with apache2.

Change-Id: I0f13f3bcb346182541376843a65d07f570f89442
2017-01-13 20:32:48 +00:00
Liam Young f3226f8dde Enable Memcache service for Token Caching
With the release of 4.2.0 of keystonemiddleware using the
in-process token cache is no longer recommended. It is recommended
that a memcache backend to store tokens is used instead,

This installs and configures memcache and configures neutron-server
to use memcache for token caching.

http://docs.openstack.org/releasenotes/keystonemiddleware/mitaka.html#id2

Change-Id: I1f7764afb24b511508432fa758596cc9ab40aba8
2016-12-12 15:03:47 +00:00
Liam Young f289429ed6 Stop/Start ceilometer-api if Apache has changed
If the charm enables https then apache is used to terminate ssl. As
part of this Apache listens on the port that the ceilometer API port
was listening on and the API service shuffles down to a lower port. If
the services are restarted one at a time and Apache goes first then
Apache will try and bind to the port the API service is listening on
because the API service has not yet been restarted to pick up its
new port.

Change-Id: Ied3224660948a9775c8000369cba0c287944cde5
Closes-Bug: 1632287
2016-10-11 15:08:44 +00:00
James Page ac4d584e51 Updates for OpenStack Newton
Ceilometer switched to using wsgi_script to generate the
ceilometer-api binary; this resulted in a few packaging changes,
including one which means the listen port for Ceilometer API is
set via the systemd unit, rather than the ceilometer.conf
configuration file.

Add systemd override file handling for ceilometer-api, including a
small workaround which ensures that the systemd daemon loads the
override configuration file when it changes (only possible during
config-changed with enabling SSL support).

This charm should switch to using Apache + mod_wsgi next cycle, at
which point all of that can just be dropped.


Change-Id: Ic8b359d0b91fda144925f5c75044f919e73aadd9
Closes-Bug: 1629796
2016-10-03 19:12:47 +00:00
James Page 928dd4c34a Add support for application version
Juju 2.0 provides support for display of the version of
an application deployed by a charm in juju status.

Insert the os_application_version_set function into the
existing assess_status function - this gets called after
all hook executions, and periodically after that, so any
changes in package versions due to normal system updates
will also be reflected in the status output.

This review also includes a resync of charm-helpers to
pickup hookenv and contrib.openstack support for this
feature.

Change-Id: I4cf3c3389def2a0dc9d0cd286aa8190cbfa59f9a
2016-09-20 11:59:16 +01:00
Leonardo Borda f3c74cc4c6 Add metering and event ttl config options
ceilometer.conf template >= Kilo does not contain metering-time-to-live
and event-time-to-live parameters. Add these options so we can control
ceilometer database growth.

Change-Id: Id5831280daeb582586bfa615268309c4abec5d63
Closes-Bug: 1561220
2016-07-11 09:25:04 +01:00
James Page 3e1cd75a8e Re-license charm as Apache-2.0
All contributions to this charm where made under Canonical
copyright; switch to Apache-2.0 license as agreed so we
can move forward with official project status.

Change-Id: I15bca9b973b61e408e25c113035702a596c45268
2016-06-28 11:36:46 +01:00
Alex Kavanagh 50af0a1bed Update/add pause/resume maintenance mode and sync charm-helpers
Adds improved pause and resume unit to the charm such tha the
charm stays paused during maintenance operations.  Updates the
basic_deployment.py to use the the new version of
python-ceilometerclient (that's available in xenial, but works
back to icehouse/precise.

Change-Id: I869e467d0e4d9fecd661a6f946d45e31535ea11e
2016-03-17 11:47:42 +00:00
James Page 0057f28731 Add full support for mitaka and drop old releases
Rework ceilometer.conf to remove use of deprecated groups and options.

Don't install aodh alarming services for Mitaka; this will be handled in
a new aodh charm.

Rework upgrade tests from precise-havana -> trusty-kilo.

Change-Id: I74112fd6206665bbb7a20eaa5be15ac85116ae03
2016-03-04 17:25:06 +00:00
Corey Bryant 96f79461e1 Use aodh-notifier and aodh-evaluator starting in Mitaka
In Mitaka, ceilometer-alarm-notifier and ceilometer-alarm-evaluator are
replaced by aodh-notifier and aodh-evaluator.
2016-01-06 14:59:34 +00:00