Ceilometer can ignore/discard measurements that come from possible
VMs that can be used to host Gnocchi. The assumption is that one
can use OpenStack itself to host the VMs that are used to run Gnocchi.
The configuration is called `filter_project`. This configuration can
be used in `event_pipeline.yaml` and `pipeline.yaml` configuration files.
However, when this config is not used, it has a default project name
for Gnocchi as `service`, as we can see in the following code snippet:
```
def __init__(self, conf, parsed_url):
super(GnocchiPublisher, self).__init__(conf, parsed_url)
# TODO(jd) allow to override Gnocchi endpoint via the host in the URL
options = urlparse.parse_qs(parsed_url.query)
self.filter_project = options.get('filter_project', ['service'])[-1]
```
Which means that if somebody creates a project called `service`, this project would not push measurements to Gnocchi.
This configuration is then used by the following code:
```
def gnocchi_project_id(self):
if self._gnocchi_project_id is not None:
return self._gnocchi_project_id
with self._gnocchi_project_id_lock:
if self._gnocchi_project_id is None:
try:
project = self._ks_client.projects.find(
name=self.filter_project,
domain=self.filter_domain)
except ka_exceptions.NotFound:
LOG.warning('filtered project not found in keystone,'
' ignoring the filter_project '
'option')
self.filter_project = None
return None
except Exception:
LOG.exception('fail to retrieve filtered project ')
raise
self._gnocchi_project_id = project.id
LOG.debug("filtered project found: %s",
self._gnocchi_project_id)
return self._gnocchi_project_id
```
Basically, this method will look for the project ID of the project
name that is configured in `filter_project` option. If it does not
find any project, it returns None, and it changes the value of
`filter_project` to None as well. Before this `gnocchi_project_id`
method/property is called, there is a verification if
`filter_project` is None. Therefore, it is assumed that when we
set the value of `filter_project` to None, this method
(`gnocchi_project_id`) would not be called anymore.
However, that is not taking into account concurrency parallel
executions.
In the code, we can see `with self._gnocchi_project_id_lock:`
statement, which seems to execute locking in the execution flow.
However, that will not always be the case because multiple
concurrent calls can be queued in that part of the code, and
when the first one finishes setting the `filter_project` to None,
the others will execute with this variable as None, which will cause
Keystone command `self._ks_client.projects.find` to find/list all
projects. That command was designed to list/find only one project;
therefore, when it finds more than one project, it throws an error.
That is the cause for the exception we were seeing from time to time
in the log files.
Change-Id: I3b4ac918015b2fd3fbe24047c3eb13419f580b27
(cherry picked from commit 463594b229)
(cherry picked from commit a059600cd7)
Ceilometer
Overview
Ceilometer is a data collection service that collects event and metering data by monitoring notifications sent from OpenStack services. It publishes collected data to various targets including data stores and message queues.
Ceilometer is distributed under the terms of the Apache License, Version 2.0. The full terms and conditions of this license are detailed in the LICENSE file.
Documentation
Release notes are available at https://releases.openstack.org/teams/telemetry.html
Developer documentation is available at https://docs.openstack.org/ceilometer/latest/
Launchpad Projects
- Server: https://launchpad.net/ceilometer
Code Repository
Bug Tracking
Release Notes
IRC
IRC Channel: #openstack-telemetry on OFTC.
Mailinglist
Project use http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-discuss
as the mailinglist. Please use tag [Ceilometer] in the
subject for new threads.