Exclude metrics from "service" project
Upon installing ceilometer and gnocchi using devstack,
"filter_project" in "pipeline.yaml" is set to "gnocchi_swift"
project. However, no such project exists in keystone.
```
publishers:
- gnocchi://?archive_policy=ceilometer-low&filter_project=gnocchi_swift
```
This change, will set "filter_project" to "service" project which
will exclude all metrics from it.
Also add the name of the project to the logs which couldn't be found
in keystone.
Closes-Bug: #1988923
Signed-off-by: Yadnesh Kulkarni <ykulkarn@redhat.com>
Change-Id: Ifc215f86134729665c142bb9bf64f66ca8de2a29
Yadnesh Kulkarni
1 year, 8 months ago
286 | 286 |
name=self.filter_project,
|
287 | 287 |
domain=self.filter_domain)
|
288 | 288 |
except ka_exceptions.NotFound:
|
289 | |
LOG.warning('filtered project not found in keystone,'
|
|
289 |
LOG.warning('project %s not found in keystone,'
|
290 | 290 |
' ignoring the filter_project '
|
291 | |
'option')
|
|
291 |
'option', self.filter_project)
|
292 | 292 |
self.filter_project = None
|
293 | 293 |
return None
|
294 | 294 |
except Exception:
|
338 | 338 |
def test_activity_gnocchi_project_not_found(self, logger):
|
339 | 339 |
self.ks_client.projects.find.side_effect = ka_exceptions.NotFound
|
340 | 340 |
self._do_test_activity_filter(2)
|
341 | |
logger.warning.assert_called_with('filtered project not found in '
|
|
341 |
logger.warning.assert_called_with('project %s not found in '
|
342 | 342 |
'keystone, ignoring the '
|
343 | |
'filter_project option')
|
|
343 |
'filter_project option', 'service')
|
344 | 344 |
|
345 | 345 |
def test_activity_filter_match_swift_event(self):
|
346 | 346 |
self.samples[0].name = 'storage.objects.outgoing.bytes'
|
207 | 207 |
if [ "$CEILOMETER_BACKEND" = 'none' ] ; then
|
208 | 208 |
echo_summary "All Ceilometer backends seems disabled, set \$CEILOMETER_BACKEND to select one."
|
209 | 209 |
elif [ "$CEILOMETER_BACKEND" = 'gnocchi' ] ; then
|
210 | |
sed -i "s/gnocchi:\/\//gnocchi:\/\/?archive_policy=${GNOCCHI_ARCHIVE_POLICY}\&filter_project=gnocchi_swift/" $CEILOMETER_CONF_DIR/event_pipeline.yaml $CEILOMETER_CONF_DIR/pipeline.yaml
|
|
210 |
sed -i "s/gnocchi:\/\//gnocchi:\/\/?archive_policy=${GNOCCHI_ARCHIVE_POLICY}\&filter_project=service/" $CEILOMETER_CONF_DIR/event_pipeline.yaml $CEILOMETER_CONF_DIR/pipeline.yaml
|
211 | 211 |
! [[ $DEVSTACK_PLUGINS =~ 'gnocchi' ]] && configure_gnocchi
|
212 | 212 |
else
|
213 | 213 |
die $LINENO "Unable to configure unknown CEILOMETER_BACKEND $CEILOMETER_BACKEND"
|