Merge "Adding support to use grafana templating"

This commit is contained in:
Zuul 2018-07-05 07:00:14 +00:00 committed by Gerrit Code Review
commit d5616a578d
2 changed files with 10 additions and 0 deletions

View File

@ -194,3 +194,9 @@ def metrics_measurement_list(request, **kwargs):
def metrics_stat_list(request, **kwargs):
result = client.monascaclient(request).metrics.list_statistics(**kwargs)
return result['elements'] if type(result) is dict else result
@profiler.trace
def metrics_dimension_value_list(request, **kwargs):
result = client.monascaclient(request).metrics.list_dimension_values(**kwargs)
return result['elements'] if type(result) is dict else result

View File

@ -316,6 +316,10 @@ class MonascaProxyView(TemplateView):
results = {'elements': api.monitor.
metrics_measurement_list(request,
**req_kwargs)}
elif "dimensions" == parts[1]:
results = {'elements': api.monitor.
metrics_dimension_value_list(request,
**req_kwargs)}
if not results:
LOG.warning("There was a request made for the path %s that"
" is not supported." % restpath)