Remove Prometheus-based metrics

Never use them
This commit is contained in:
Claudio Ortolina
2025-05-15 16:14:26 +01:00
parent 112e2e455a
commit 0577f72484
6 changed files with 0 additions and 64 deletions
-4
View File
@@ -40,7 +40,3 @@ soft_limit = 1000
memory = '512mb' memory = '512mb'
cpu_kind = 'shared' cpu_kind = 'shared'
cpus = 1 cpus = 1
[metrics]
path = "/metrics"
port = 8080
-2
View File
@@ -15,8 +15,6 @@ defmodule MusicLibraryWeb.Endpoint do
encrypt: true encrypt: true
] ]
plug MusicLibraryWeb.Telemetry.Plug, at: "/metrics"
socket "/live", Phoenix.LiveView.Socket, socket "/live", Phoenix.LiveView.Socket,
websocket: [connect_info: [session: @session_options]], websocket: [connect_info: [session: @session_options]],
longpoll: [connect_info: [session: @session_options]] longpoll: [connect_info: [session: @session_options]]
-34
View File
@@ -10,7 +10,6 @@ defmodule MusicLibraryWeb.Telemetry do
def init(_arg) do def init(_arg) do
children = [ children = [
{MusicLibraryWeb.Telemetry.Storage, metrics()}, {MusicLibraryWeb.Telemetry.Storage, metrics()},
{TelemetryMetricsPrometheus.Core, [metrics: prometheus_metrics()]},
# Telemetry poller will execute the given period measurements # Telemetry poller will execute the given period measurements
# every 10_000ms. Learn more here: https://hexdocs.pm/telemetry_metrics # every 10_000ms. Learn more here: https://hexdocs.pm/telemetry_metrics
{:telemetry_poller, measurements: periodic_measurements(), period: 10_000} {:telemetry_poller, measurements: periodic_measurements(), period: 10_000}
@@ -104,39 +103,6 @@ defmodule MusicLibraryWeb.Telemetry do
] ]
end end
def prometheus_metrics do
[
# VM Metrics
last_value("vm.memory.total", unit: {:byte, :megabyte}),
last_value("vm.total_run_queue_lengths.total"),
last_value("vm.total_run_queue_lengths.cpu"),
last_value("vm.total_run_queue_lengths.io"),
# Database Metrics
last_value("music_library.repo.query.total_time",
unit: {:native, :millisecond},
description: "The sum of the other measurements"
),
last_value("music_library.repo.query.decode_time",
unit: {:native, :millisecond},
description: "The time spent decoding the data received from the database"
),
last_value("music_library.repo.query.query_time",
unit: {:native, :millisecond},
description: "The time spent executing the query"
),
last_value("music_library.repo.query.queue_time",
unit: {:native, :millisecond},
description: "The time spent waiting for a database connection"
),
last_value("music_library.repo.query.idle_time",
unit: {:native, :millisecond},
description:
"The time the connection spent waiting before being checked out for the query"
)
]
end
defp periodic_measurements do defp periodic_measurements do
[ [
# A module, function and arguments to be invoked periodically. # A module, function and arguments to be invoked periodically.
-22
View File
@@ -1,22 +0,0 @@
defmodule MusicLibraryWeb.Telemetry.Plug do
@behaviour Plug
import Plug.Conn
def init(opts) do
Keyword.validate!(opts, [:at])
end
def call(conn, opts) do
at = Keyword.fetch!(opts, :at)
if conn.request_path == at do
conn
|> put_resp_content_type("text/plain")
|> send_resp(200, TelemetryMetricsPrometheus.Core.scrape())
|> halt()
else
conn
end
end
end
-1
View File
@@ -101,7 +101,6 @@ defmodule MusicLibrary.MixProject do
# Prod error/perf tooling # Prod error/perf tooling
{:phoenix_live_dashboard, "~> 0.8.3"}, {:phoenix_live_dashboard, "~> 0.8.3"},
{:telemetry_metrics_prometheus_core, "~> 1.2"},
{:error_tracker, "~> 0.6.0"}, {:error_tracker, "~> 0.6.0"},
{:recon, "~> 2.5"}, {:recon, "~> 2.5"},
{:telemetry_metrics, "~> 1.0"}, {:telemetry_metrics, "~> 1.0"},
-1
View File
@@ -55,7 +55,6 @@
"tailwind": {:hex, :tailwind, "0.3.1", "a89d2835c580748c7a975ad7dd3f2ea5e63216dc16d44f9df492fbd12c094bed", [:mix], [], "hexpm", "98a45febdf4a87bc26682e1171acdedd6317d0919953c353fcd1b4f9f4b676a2"}, "tailwind": {:hex, :tailwind, "0.3.1", "a89d2835c580748c7a975ad7dd3f2ea5e63216dc16d44f9df492fbd12c094bed", [:mix], [], "hexpm", "98a45febdf4a87bc26682e1171acdedd6317d0919953c353fcd1b4f9f4b676a2"},
"telemetry": {:hex, :telemetry, "1.3.0", "fedebbae410d715cf8e7062c96a1ef32ec22e764197f70cda73d82778d61e7a2", [:rebar3], [], "hexpm", "7015fc8919dbe63764f4b4b87a95b7c0996bd539e0d499be6ec9d7f3875b79e6"}, "telemetry": {:hex, :telemetry, "1.3.0", "fedebbae410d715cf8e7062c96a1ef32ec22e764197f70cda73d82778d61e7a2", [:rebar3], [], "hexpm", "7015fc8919dbe63764f4b4b87a95b7c0996bd539e0d499be6ec9d7f3875b79e6"},
"telemetry_metrics": {:hex, :telemetry_metrics, "1.1.0", "5bd5f3b5637e0abea0426b947e3ce5dd304f8b3bc6617039e2b5a008adc02f8f", [:mix], [{:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "e7b79e8ddfde70adb6db8a6623d1778ec66401f366e9a8f5dd0955c56bc8ce67"}, "telemetry_metrics": {:hex, :telemetry_metrics, "1.1.0", "5bd5f3b5637e0abea0426b947e3ce5dd304f8b3bc6617039e2b5a008adc02f8f", [:mix], [{:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "e7b79e8ddfde70adb6db8a6623d1778ec66401f366e9a8f5dd0955c56bc8ce67"},
"telemetry_metrics_prometheus_core": {:hex, :telemetry_metrics_prometheus_core, "1.2.1", "c9755987d7b959b557084e6990990cb96a50d6482c683fb9622a63837f3cd3d8", [:mix], [{:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}, {:telemetry_metrics, "~> 0.6 or ~> 1.0", [hex: :telemetry_metrics, repo: "hexpm", optional: false]}], "hexpm", "5e2c599da4983c4f88a33e9571f1458bf98b0cf6ba930f1dc3a6e8cf45d5afb6"},
"telemetry_poller": {:hex, :telemetry_poller, "1.2.0", "ba82e333215aed9dd2096f93bd1d13ae89d249f82760fcada0850ba33bac154b", [:rebar3], [{:telemetry, "~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "7216e21a6c326eb9aa44328028c34e9fd348fb53667ca837be59d0aa2a0156e8"}, "telemetry_poller": {:hex, :telemetry_poller, "1.2.0", "ba82e333215aed9dd2096f93bd1d13ae89d249f82760fcada0850ba33bac154b", [:rebar3], [{:telemetry, "~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "7216e21a6c326eb9aa44328028c34e9fd348fb53667ca837be59d0aa2a0156e8"},
"thousand_island": {:hex, :thousand_island, "1.3.13", "d598c609172275f7b1648c9f6eddf900e42312b09bfc2f2020358f926ee00d39", [:mix], [{:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "5a34bdf24ae2f965ddf7ba1a416f3111cfe7df50de8d66f6310e01fc2e80b02a"}, "thousand_island": {:hex, :thousand_island, "1.3.13", "d598c609172275f7b1648c9f6eddf900e42312b09bfc2f2020358f926ee00d39", [:mix], [{:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "5a34bdf24ae2f965ddf7ba1a416f3111cfe7df50de8d66f6310e01fc2e80b02a"},
"tidewave": {:hex, :tidewave, "0.1.6", "f07514ee2c348c2e682a2632309ac6d8ec425392bfb803955a6bb19ca5508e2f", [:mix], [{:circular_buffer, "~> 0.4", [hex: :circular_buffer, repo: "hexpm", optional: false]}, {:igniter, ">= 0.5.47 and < 1.0.0-0", [hex: :igniter, repo: "hexpm", optional: true]}, {:jason, "~> 1.4", [hex: :jason, repo: "hexpm", optional: false]}, {:plug, "~> 1.17", [hex: :plug, repo: "hexpm", optional: false]}, {:req, "~> 0.5", [hex: :req, repo: "hexpm", optional: false]}], "hexpm", "3708592f325e1f54b99b215cd8c38f726732451bf5cfa16d73584793f99d9da4"}, "tidewave": {:hex, :tidewave, "0.1.6", "f07514ee2c348c2e682a2632309ac6d8ec425392bfb803955a6bb19ca5508e2f", [:mix], [{:circular_buffer, "~> 0.4", [hex: :circular_buffer, repo: "hexpm", optional: false]}, {:igniter, ">= 0.5.47 and < 1.0.0-0", [hex: :igniter, repo: "hexpm", optional: true]}, {:jason, "~> 1.4", [hex: :jason, repo: "hexpm", optional: false]}, {:plug, "~> 1.17", [hex: :plug, repo: "hexpm", optional: false]}, {:req, "~> 0.5", [hex: :req, repo: "hexpm", optional: false]}], "hexpm", "3708592f325e1f54b99b215cd8c38f726732451bf5cfa16d73584793f99d9da4"},