Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/realtime/metrics_cleaner.ex
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ defmodule Realtime.MetricsCleaner do
defp loop_and_cleanup_metrics_table do
tenant_ids = Realtime.Tenants.Connect.list_tenants() |> MapSet.new()

{_, tid} = Peep.Persistent.storage(Realtime.PromEx.Metrics)
{_, {tid, _}} = Peep.Persistent.storage(Realtime.PromEx.Metrics)

tid
|> :ets.select(@peep_filter_spec)
Expand Down
2 changes: 1 addition & 1 deletion lib/realtime/monitoring/prom_ex.ex
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ defmodule Realtime.PromEx do
name: name,
metrics: metrics,
global_tags: Application.get_env(:realtime, :metrics_tags, %{}),
storage: :default
storage: {:default, 4}
)
end
end
Expand Down
4 changes: 2 additions & 2 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ defmodule Realtime.MixProject do
def project do
[
app: :realtime,
version: "2.68.7",
version: "2.69.0",
elixir: "~> 1.18",
elixirc_paths: elixirc_paths(Mix.env()),
start_permanent: Mix.env() == :prod,
Expand Down Expand Up @@ -74,7 +74,7 @@ defmodule Realtime.MixProject do
{:libcluster_postgres, "~> 0.2"},
{:uuid, "~> 1.1"},
{:prom_ex, "~> 1.10"},
{:peep, "~> 4.0", override: true},
{:peep, git: "https://github.com/supabase/peep.git", branch: "feat/partitions-ets", override: true},
{:joken, "~> 2.5.0"},
{:ex_json_schema, "~> 0.7"},
{:recon, "~> 2.5"},
Expand Down
2 changes: 1 addition & 1 deletion mix.lock
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"opentelemetry_semantic_conventions": {:hex, :opentelemetry_semantic_conventions, "1.27.0", "acd0194a94a1e57d63da982ee9f4a9f88834ae0b31b0bd850815fe9be4bbb45f", [:mix, :rebar3], [], "hexpm", "9681ccaa24fd3d810b4461581717661fd85ff7019b082c2dff89c7d5b1fc2864"},
"opentelemetry_telemetry": {:hex, :opentelemetry_telemetry, "1.1.2", "410ab4d76b0921f42dbccbe5a7c831b8125282850be649ee1f70050d3961118a", [:mix, :rebar3], [{:opentelemetry_api, "~> 1.3", [hex: :opentelemetry_api, repo: "hexpm", optional: false]}, {:telemetry, "~> 1.1", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "641ab469deb181957ac6d59bce6e1321d5fe2a56df444fc9c19afcad623ab253"},
"otel_http": {:hex, :otel_http, "0.2.0", "b17385986c7f1b862f5d577f72614ecaa29de40392b7618869999326b9a61d8a", [:rebar3], [], "hexpm", "f2beadf922c8cfeb0965488dd736c95cc6ea8b9efce89466b3904d317d7cc717"},
"peep": {:hex, :peep, "4.2.1", "dbb17e880acbe8e43cdc29b15576d736b613d412c94f9abae4a7a77d89aba98e", [:mix], [{:nimble_options, "~> 1.1", [hex: :nimble_options, repo: "hexpm", optional: false]}, {:plug, "~> 1.16", [hex: :plug, repo: "hexpm", optional: true]}, {:telemetry, "~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}, {:telemetry_metrics, "~> 1.0", [hex: :telemetry_metrics, repo: "hexpm", optional: false]}], "hexpm", "2f966ac06c6a02bb3721e79a5f68fa769070eea60d44d210529c42d54623e97e"},
"peep": {:git, "https://github.com/supabase/peep.git", "3ba8f8f77f4c8dae734f9d8f603c24c1046502da", [branch: "feat/partitions-ets"]},
"phoenix": {:git, "https://github.com/supabase/phoenix.git", "7b884cc0cc1a49ad2bc272acda2e622b3e11c139", [branch: "feat/presence-custom-dispatcher-1.7.19"]},
"phoenix_ecto": {:hex, :phoenix_ecto, "4.4.3", "86e9878f833829c3f66da03d75254c155d91d72a201eb56ae83482328dc7ca93", [:mix], [{:ecto, "~> 3.5", [hex: :ecto, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 2.14.2 or ~> 3.0 or ~> 4.0", [hex: :phoenix_html, repo: "hexpm", optional: true]}, {:plug, "~> 1.9", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "d36c401206f3011fefd63d04e8ef626ec8791975d9d107f9a0817d426f61ac07"},
"phoenix_html": {:hex, :phoenix_html, "3.3.4", "42a09fc443bbc1da37e372a5c8e6755d046f22b9b11343bf885067357da21cb3", [:mix], [{:plug, "~> 1.5", [hex: :plug, repo: "hexpm", optional: true]}], "hexpm", "0249d3abec3714aff3415e7ee3d9786cb325be3151e6c4b3021502c585bf53fb"},
Expand Down
16 changes: 8 additions & 8 deletions test/realtime/monitoring/prometheus_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ defmodule Realtime.Monitoring.PrometheusTest do
:ok
end

@impls [:default, :striped]
@impls [:default, {:default, 4}, :striped]

for impl <- @impls do
test "#{impl} - counter formatting" do
test "#{inspect(impl)} - counter formatting" do
counter = Metrics.counter("prometheus.test.counter", description: "a counter")
name = StorageCounter.fresh_id()

Expand All @@ -54,7 +54,7 @@ defmodule Realtime.Monitoring.PrometheusTest do
assert export(name) == lines_to_string(expected)
end

describe "#{impl} - sum" do
describe "#{inspect(impl)} - sum" do
test "sum formatting" do
name = StorageCounter.fresh_id()
sum = Metrics.sum("prometheus.test.sum", description: "a sum")
Expand Down Expand Up @@ -109,7 +109,7 @@ defmodule Realtime.Monitoring.PrometheusTest do
end
end

describe "#{impl} - last_value" do
describe "#{inspect(impl)} - last_value" do
test "formatting" do
name = StorageCounter.fresh_id()
last_value = Metrics.last_value("prometheus.test.gauge", description: "a last_value")
Expand Down Expand Up @@ -162,7 +162,7 @@ defmodule Realtime.Monitoring.PrometheusTest do
end
end

test "#{impl} - dist formatting" do
test "#{inspect(impl)} - dist formatting" do
name = StorageCounter.fresh_id()

dist =
Expand Down Expand Up @@ -281,7 +281,7 @@ defmodule Realtime.Monitoring.PrometheusTest do
assert export(name) == lines_to_string(expected)
end

test "#{impl} - dist formatting pow10" do
test "#{inspect(impl)} - dist formatting pow10" do
name = StorageCounter.fresh_id()

dist =
Expand Down Expand Up @@ -354,7 +354,7 @@ defmodule Realtime.Monitoring.PrometheusTest do
assert export(name) == lines_to_string(expected)
end

test "#{impl} - regression: label escaping" do
test "#{inspect(impl)} - regression: label escaping" do
name = StorageCounter.fresh_id()

counter =
Expand Down Expand Up @@ -388,7 +388,7 @@ defmodule Realtime.Monitoring.PrometheusTest do
assert export(name) == lines_to_string(expected)
end

test "#{impl} - regression: handle structs without String.Chars" do
test "#{inspect(impl)} - regression: handle structs without String.Chars" do
name = StorageCounter.fresh_id()

counter =
Expand Down