diff --git a/lib/sanbase/alerts/struct_map_transformation.ex b/lib/sanbase/alerts/struct_map_transformation.ex index 6154edc68..b097902b0 100644 --- a/lib/sanbase/alerts/struct_map_transformation.ex +++ b/lib/sanbase/alerts/struct_map_transformation.ex @@ -90,9 +90,10 @@ defmodule Sanbase.Alert.StructMapTransformation do [{:erlang, :binary_to_existing_atom, [str, _], _} | _] = __STACKTRACE__ errors = Process.get(@unsupported_fields_error, []) + field = if is_binary(str), do: str, else: inspect(str) Process.put(@unsupported_fields_error, [ - ~s/The trigger contains unsupported or mistyped field "#{str}"/ | errors + ~s/The trigger contains unsupported or mistyped field "#{field}"/ | errors ]) acc diff --git a/lib/sanbase/clickhouse/metric/metric_adapter.ex b/lib/sanbase/clickhouse/metric/metric_adapter.ex index 87cb045bd..40e0258c2 100644 --- a/lib/sanbase/clickhouse/metric/metric_adapter.ex +++ b/lib/sanbase/clickhouse/metric/metric_adapter.ex @@ -264,7 +264,7 @@ defmodule Sanbase.Clickhouse.MetricAdapter do @impl Sanbase.Metric.Behaviour def available_slugs(metric) do cond do - "age_distribution" -> + metric == "age_distribution" -> # avoid infinite loop if it goes into HistogramMetric get_available_slugs(metric)