diff --git a/api/chalicelib/core/custom_metrics.py b/api/chalicelib/core/custom_metrics.py index 944bebc4f..0a6845004 100644 --- a/api/chalicelib/core/custom_metrics.py +++ b/api/chalicelib/core/custom_metrics.py @@ -572,6 +572,9 @@ def make_chart_from_card(project_id, user_id, metric_id, data: schemas.CardChart raw_metric: dict = get_card(metric_id=metric_id, project_id=project_id, user_id=user_id, include_data=True) if raw_metric is None: raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail="card not found") + print("<<<<<<<<<<<<>") + print(raw_metric) + print("<<<<<<<<<<<<>") metric: schemas.CreateCardSchema = schemas.CreateCardSchema(**raw_metric) if metric.is_template: return get_predefined_metric(key=metric.metric_of, project_id=project_id, data=data.dict()) diff --git a/api/chalicelib/core/metrics.py b/api/chalicelib/core/metrics.py index b25b441ed..1fadc2adc 100644 --- a/api/chalicelib/core/metrics.py +++ b/api/chalicelib/core/metrics.py @@ -1610,7 +1610,7 @@ def get_domains_errors(project_id, startTimestamp=TimeUTC.now(delta_days=-1), "status_code": 4, **__get_constraint_values(args)} cur.execute(cur.mogrify(pg_query, params)) rows = cur.fetchall() - rows = __nested_array_to_dict_array(rows) + rows = __nested_array_to_dict_array(rows, key="host") neutral = __get_neutral(rows) rows = __merge_rows_with_neutral(rows, neutral) @@ -1618,7 +1618,7 @@ def get_domains_errors(project_id, startTimestamp=TimeUTC.now(delta_days=-1), params["status_code"] = 5 cur.execute(cur.mogrify(pg_query, params)) rows = cur.fetchall() - rows = __nested_array_to_dict_array(rows) + rows = __nested_array_to_dict_array(rows, key="host") neutral = __get_neutral(rows) rows = __merge_rows_with_neutral(rows, neutral) result["5xx"] = rows @@ -1658,7 +1658,7 @@ def __get_domains_errors_4xx_and_5xx(status, project_id, startTimestamp=TimeUTC. "status_code": status, **__get_constraint_values(args)} cur.execute(cur.mogrify(pg_query, params)) rows = cur.fetchall() - rows = __nested_array_to_dict_array(rows) + rows = __nested_array_to_dict_array(rows, key="host") neutral = __get_neutral(rows) rows = __merge_rows_with_neutral(rows, neutral)