Fix Grafana URL in email notification

- Remove prefix 'dim_' from dimensions in Drilldown Dashboard
- Same was done for Monasca-UI [1]

[1] https://review.opendev.org/c/openstack/monasca-ui/+/782599

Change-Id: I69e3e7db54b995e45810532a1dd940ac8b68921f
This commit is contained in:
Martin Chacon Piza 2021-06-18 09:59:47 +02:00
parent 54f66e9b75
commit fa2454a3c9
2 changed files with 2 additions and 2 deletions

View File

@ -259,7 +259,7 @@ class EmailNotifier(abstract_notifier.AbstractNotifier):
dimensions = metric['dimensions']
for key, value in dimensions.items():
metric_query += "&dim_%s=%s" % (key, value)
metric_query += "&%s=%s" % (key, value)
# Show the graph within a range of ten minutes before and after the alarm occurred.
offset = 600000

View File

@ -475,7 +475,7 @@ class TestEmail(base.PluginTestCase):
# Then the following link to Grafana (including the metric info and timestamp) is expected.
expected_url = "http://127.0.0.1:3000/dashboard/script/drilldown.js" \
"?metric=cpu.percent&dim_hostname=foo1&dim_service=bar1" \
"?metric=cpu.percent&hostname=foo1&service=bar1" \
"&from=%s&to=%s" % (expected_from_ms, expected_to_ms)
self._assert_equal_urls(expected_url, result_url)