diff options
author | Yadnesh Kulkarni <ykulkarn@redhat.com> | 2022-08-10 05:18:38 -0400 |
---|---|---|
committer | Yadnesh Kulkarni <ykulkarn@redhat.com> | 2022-09-07 19:41:20 +0530 |
commit | 8e57a3a6f34fba3d89775b8b937b83524497dcfd (patch) | |
tree | 683514e86e6f231a6d367698469c6cc20bd36a99 /ceilometer | |
parent | fb184a9e594acfd22d6d15cc71fb5d8f94752a17 (diff) | |
download | ceilometer-8e57a3a6f34fba3d89775b8b937b83524497dcfd.tar.gz |
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
Diffstat (limited to 'ceilometer')
-rw-r--r-- | ceilometer/publisher/gnocchi.py | 4 | ||||
-rw-r--r-- | ceilometer/tests/unit/publisher/test_gnocchi.py | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/ceilometer/publisher/gnocchi.py b/ceilometer/publisher/gnocchi.py index 19d7d54b..530013f9 100644 --- a/ceilometer/publisher/gnocchi.py +++ b/ceilometer/publisher/gnocchi.py @@ -287,9 +287,9 @@ class GnocchiPublisher(publisher.ConfigPublisherBase): name=self.filter_project, domain=self.filter_domain) except ka_exceptions.NotFound: - LOG.warning('filtered project not found in keystone,' + LOG.warning('project %s not found in keystone,' ' ignoring the filter_project ' - 'option') + 'option', self.filter_project) self.filter_project = None return None except Exception: diff --git a/ceilometer/tests/unit/publisher/test_gnocchi.py b/ceilometer/tests/unit/publisher/test_gnocchi.py index 236da69b..e5d307c4 100644 --- a/ceilometer/tests/unit/publisher/test_gnocchi.py +++ b/ceilometer/tests/unit/publisher/test_gnocchi.py @@ -339,9 +339,9 @@ class PublisherTest(base.BaseTestCase): def test_activity_gnocchi_project_not_found(self, logger): self.ks_client.projects.find.side_effect = ka_exceptions.NotFound self._do_test_activity_filter(2) - logger.warning.assert_called_with('filtered project not found in ' + logger.warning.assert_called_with('project %s not found in ' 'keystone, ignoring the ' - 'filter_project option') + 'filter_project option', 'service') def test_activity_filter_match_swift_event(self): self.samples[0].name = 'storage.objects.outgoing.bytes' |