From 93a969a99f44765b0eeef568fafb9aa410e3c1a4 Mon Sep 17 00:00:00 2001 From: Jaromir Wysoglad Date: Wed, 9 Apr 2025 07:57:49 -0400 Subject: [PATCH] Fix observabilityclient-dsvm-functional job There were some changes to the sg-core devstack plugin, to which we need to react. These changes are similar to what was done in the telemetry-tempest-plugin recently: https://review.opendev.org/c/openstack/telemetry-tempest-plugin/+/945108 https://review.opendev.org/c/openstack/telemetry-tempest-plugin/+/937371 Use PROMETHEUS_CUSTOM_SCRAPE_TARGETS to pass sg_core scrape endpoint https://review.opendev.org/c/openstack/devstack-plugin-prometheus/+/950476 adds the support for passing custom prometheus scrape target in d-p-p. Let's use the same to pass sg_core endpoint. Cherry-picked from these 2 commits on master, without conflicts (both at once need to be applied to pass CI): 2fc3646ac5ce2a58307c0ea2c6d9a99033829a43 34781c5e4f232ffcc4440c7835ac3b9499c15552 Change-Id: I5c1885a3ca9d732d41db140a0feb4c87925b5a48 Co-Authored-By: Chandan Kumar (raukadah) Signed-off-by: Elod Illes Signed-off-by: Jaromir Wysoglad --- .zuul.yaml | 12 ++++++++++-- observabilityclient/tests/functional/test_cli.py | 4 ++-- .../tests/functional/test_python_api.py | 4 ++-- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/.zuul.yaml b/.zuul.yaml index d26f572..a1cbb9c 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -8,16 +8,24 @@ required-projects: - openstack/python-observabilityclient - openstack/ceilometer - - infrawatch/sg-core + - openstack-k8s-operators/sg-core + - openstack/devstack-plugin-prometheus timeout: 4200 vars: devstack_localrc: USE_PYTHON3: True PROMETHEUS_SERVICE_SCRAPE_TARGETS: prometheus,sg-core CEILOMETER_BACKEND: sg-core + PROMETHEUS_CUSTOM_SCRAPE_TARGETS: "localhost:3000,localhost:9090" devstack_plugins: - sg-core: https://github.com/infrawatch/sg-core + sg-core: https://github.com/openstack-k8s-operators/sg-core ceilometer: https://opendev.org/openstack/ceilometer + devstack-plugin-prometheus: https://opendev.org/openstack/devstack-plugin-prometheus + devstack_services: + node_exporter: false + zuul_copy_output: + /etc/prometheus/prometheus.yml: logs + /etc/openstack/prometheus.yaml: logs - project: queue: telemetry diff --git a/observabilityclient/tests/functional/test_cli.py b/observabilityclient/tests/functional/test_cli.py index 626be60..4a8c053 100644 --- a/observabilityclient/tests/functional/test_cli.py +++ b/observabilityclient/tests/functional/test_cli.py @@ -88,7 +88,7 @@ class CliTestFunctionalRBACEnabled(base.CliTestCase): metric["__name__"] ) self.assertEqual( - "sg-core", + "custom", metric["job"] ) @@ -103,7 +103,7 @@ class CliTestFunctionalRBACEnabled(base.CliTestCase): metric["__name__"] ) self.assertEqual( - "sg-core", + "custom", metric["job"] ) diff --git a/observabilityclient/tests/functional/test_python_api.py b/observabilityclient/tests/functional/test_python_api.py index 8f3bf85..162b7d8 100644 --- a/observabilityclient/tests/functional/test_python_api.py +++ b/observabilityclient/tests/functional/test_python_api.py @@ -52,7 +52,7 @@ class PythonAPITestFunctionalRBACEnabled(base.PythonAPITestCase): for metric in ret: self.assertEqual("ceilometer_image_size", metric.labels["__name__"]) - self.assertEqual("sg-core", + self.assertEqual("custom", metric.labels["job"]) def test_query(self): @@ -62,7 +62,7 @@ class PythonAPITestFunctionalRBACEnabled(base.PythonAPITestCase): for metric in ret: self.assertEqual("ceilometer_image_size", metric.labels["__name__"]) - self.assertEqual("sg-core", metric.labels["job"]) + self.assertEqual("custom", metric.labels["job"]) class PythonAPITestFunctionalAdminCommands(base.PythonAPITestCase):