From 36d1b6773f2d06f2d438909eec3057f8a394b829 Mon Sep 17 00:00:00 2001 From: Svyat Sobol Date: Wed, 6 Nov 2024 14:49:03 +0200 Subject: [PATCH] Improve safety of reporting diagnostic methods and adjust metric name --- lib/telemetry_metrics_statsd.ex | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/telemetry_metrics_statsd.ex b/lib/telemetry_metrics_statsd.ex index 91b2815..4502d58 100644 --- a/lib/telemetry_metrics_statsd.ex +++ b/lib/telemetry_metrics_statsd.ex @@ -596,7 +596,7 @@ defmodule TelemetryMetricsStatsd do case item do {:udp_worker, udp_worker} -> :telemetry.execute( - [:telemetry_metrics_statsd, :udp_worker_metrics], + [:telemetry_metrics_statsd, :udp_metrics], %{ message_queue_len: message_queue_len(udp_worker), }, @@ -611,6 +611,11 @@ defmodule TelemetryMetricsStatsd do schedule_metrics_report(state.diagnostic_metrics_report_interval) {:noreply, state} + rescue + _ -> + Logger.error("Failed to report diagnostic metrics") + + {:noreply, state} end @impl true