mirror of
https://github.com/ansible/awx.git
synced 2026-01-12 10:30:03 -03:30
Merge pull request #4482 from ryanpetrello/prometheus_errors
fix a bug in the API metrics endpoint Reviewed-by: https://github.com/softwarefactory-project-zuul[bot]
This commit is contained in:
commit
7374732d9b
@ -109,6 +109,11 @@ class AnsiDownloadRenderer(PlainTextRenderer):
|
||||
class PrometheusJSONRenderer(renderers.JSONRenderer):
|
||||
|
||||
def render(self, data, accepted_media_type=None, renderer_context=None):
|
||||
if isinstance(data, dict):
|
||||
# HTTP errors are {'detail': ErrorDetail(string='...', code=...)}
|
||||
return super(PrometheusJSONRenderer, self).render(
|
||||
data, accepted_media_type, renderer_context
|
||||
)
|
||||
parsed_metrics = text_string_to_metric_families(data)
|
||||
data = {}
|
||||
for family in parsed_metrics:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user