From 18655dc4dcf21fb50c8b6ad7286e5680c172ba24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Jan=20Niemier?= Date: Fri, 22 Nov 2024 11:09:13 +0100 Subject: [PATCH] fix: use Peep for metrics gathering --- config/config.exs | 2 ++ lib/supavisor/monitoring/prom_ex.ex | 2 +- lib/supavisor/monitoring/tenant.ex | 4 ---- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/config/config.exs b/config/config.exs index 36ca234d..46291625 100644 --- a/config/config.exs +++ b/config/config.exs @@ -16,6 +16,8 @@ config :supavisor, reconnect_retries: System.get_env("RECONNECT_RETRIES", "5") |> String.to_integer(), subscribe_retries: System.get_env("SUBSCRIBE_RETRIES", "20") |> String.to_integer() +config :prom_ex, storage_adapter: PromEx.Storage.Peep + # Configures the endpoint config :supavisor, SupavisorWeb.Endpoint, url: [host: "localhost"], diff --git a/lib/supavisor/monitoring/prom_ex.ex b/lib/supavisor/monitoring/prom_ex.ex index 48b762d3..1d0faa72 100644 --- a/lib/supavisor/monitoring/prom_ex.ex +++ b/lib/supavisor/monitoring/prom_ex.ex @@ -5,7 +5,7 @@ defmodule Supavisor.Monitoring.PromEx do and provides a function to remove remote metrics associated with a specific tenant. """ - use PromEx, otp_app: :supavisor, store: PromEx.Storage.Peep + use PromEx, otp_app: :supavisor require Logger alias PromEx.Plugins diff --git a/lib/supavisor/monitoring/tenant.ex b/lib/supavisor/monitoring/tenant.ex index d4fa9544..d129b343 100644 --- a/lib/supavisor/monitoring/tenant.ex +++ b/lib/supavisor/monitoring/tenant.ex @@ -44,7 +44,6 @@ defmodule Supavisor.PromEx.Plugins.Tenant do tags: @tags, unit: {:native, :millisecond}, reporter_options: [ - buckets: [1, 5, 10, 100, 1_000, 5_000, 10_000], peep_bucket_calculator: Buckets ] ), @@ -56,7 +55,6 @@ defmodule Supavisor.PromEx.Plugins.Tenant do tags: @tags, unit: {:native, :millisecond}, reporter_options: [ - buckets: [1, 5, 10, 100, 1_000, 5_000, 10_000], peep_bucket_calculator: Buckets ] ), @@ -68,7 +66,6 @@ defmodule Supavisor.PromEx.Plugins.Tenant do tags: @tags, unit: {:native, :millisecond}, reporter_options: [ - buckets: [1, 5, 10, 100, 1_000, 5_000, 10_000], peep_bucket_calculator: Buckets ] ), @@ -80,7 +77,6 @@ defmodule Supavisor.PromEx.Plugins.Tenant do tags: @tags, unit: {:native, :millisecond}, reporter_options: [ - buckets: [1, 5, 10, 100, 1_000, 5_000, 10_000], peep_bucket_calculator: Buckets ] ),