[#3059] Fixed Phoenix 1.5 telemetry processing.
authorIvan Tashkinov <ivantashkinov@gmail.com>
Thu, 22 Oct 2020 10:54:15 +0000 (13:54 +0300)
committerIvan Tashkinov <ivantashkinov@gmail.com>
Thu, 22 Oct 2020 10:54:15 +0000 (13:54 +0300)
lib/pleroma/application.ex
lib/pleroma/web/endpoint.ex
mix.exs
mix.lock

index d7e3a649fdaf9d303256aae8e75dc5408516677d..51e9dda3babf7ebafd5ca84887d477af7912d979 100644 (file)
@@ -151,7 +151,10 @@ defmodule Pleroma.Application do
 
     Pleroma.Web.Endpoint.MetricsExporter.setup()
     Pleroma.Web.Endpoint.PipelineInstrumenter.setup()
-    Pleroma.Web.Endpoint.Instrumenter.setup()
+
+    # Note: disabled until prometheus-phx is integrated into prometheus-phoenix:
+    # Pleroma.Web.Endpoint.Instrumenter.setup()
+    PrometheusPhx.setup()
   end
 
   defp cachex_children do
index 56562c12fc5ed46a6c3efcd00ac955a2e51e2afd..f15aab8cb6c731ecd1158a9397740ad20e4c0af4 100644 (file)
@@ -9,6 +9,8 @@ defmodule Pleroma.Web.Endpoint do
 
   socket("/socket", Pleroma.Web.UserSocket)
 
+  plug Plug.Telemetry, event_prefix: [:phoenix, :endpoint]
+
   plug(Pleroma.Web.Plugs.SetLocalePlug)
   plug(CORSPlug)
   plug(Pleroma.Web.Plugs.HTTPSecurityPlug)
diff --git a/mix.exs b/mix.exs
index c943d3e17d34005af30553d86ae6fc92ddef8c18..c9fca1b6eb5c81df2d61bcd6c1805fe7f254c1b5 100644 (file)
--- a/mix.exs
+++ b/mix.exs
@@ -171,6 +171,8 @@ defmodule Pleroma.Mixfile do
        override: true},
       {:prometheus_plugs, "~> 1.1"},
       {:prometheus_phoenix, "~> 1.3"},
+      # Note: once `prometheus_phx` is integrated into `prometheus_phoenix`, remove the former:
+      {:prometheus_phx, github: "theblitzapp/prometheus-phx"},
       {:prometheus_ecto, "~> 1.4"},
       {:recon, "~> 2.5"},
       {:quack, "~> 0.1.1"},
index 8972959daa833832cf7601db80c52814d28cc1b5..159804e04f2dd7e3518cf62a54be135c732506fb 100644 (file)
--- a/mix.lock
+++ b/mix.lock
   "prometheus_ecto": {:hex, :prometheus_ecto, "1.4.3", "3dd4da1812b8e0dbee81ea58bb3b62ed7588f2eae0c9e97e434c46807ff82311", [:mix], [{:ecto, "~> 2.0 or ~> 3.0", [hex: :ecto, repo: "hexpm", optional: false]}, {:prometheus_ex, "~> 1.1 or ~> 2.0 or ~> 3.0", [hex: :prometheus_ex, repo: "hexpm", optional: false]}], "hexpm", "8d66289f77f913b37eda81fd287340c17e61a447549deb28efc254532b2bed82"},
   "prometheus_ex": {:git, "https://git.pleroma.social/pleroma/elixir-libraries/prometheus.ex.git", "a4e9beb3c1c479d14b352fd9d6dd7b1f6d7deee5", [ref: "a4e9beb3c1c479d14b352fd9d6dd7b1f6d7deee5"]},
   "prometheus_phoenix": {:hex, :prometheus_phoenix, "1.3.0", "c4b527e0b3a9ef1af26bdcfbfad3998f37795b9185d475ca610fe4388fdd3bb5", [:mix], [{:phoenix, "~> 1.4", [hex: :phoenix, repo: "hexpm", optional: false]}, {:prometheus_ex, "~> 1.3 or ~> 2.0 or ~> 3.0", [hex: :prometheus_ex, repo: "hexpm", optional: false]}], "hexpm", "c4d1404ac4e9d3d963da601db2a7d8ea31194f0017057fabf0cfb9bf5a6c8c75"},
+  "prometheus_phx": {:git, "https://github.com/theblitzapp/prometheus-phx.git", "0c950ac2d145b1ee3fc8ee5c3290ccb9ef2331e9", []},
   "prometheus_plugs": {:hex, :prometheus_plugs, "1.1.5", "25933d48f8af3a5941dd7b621c889749894d8a1082a6ff7c67cc99dec26377c5", [:mix], [{:accept, "~> 0.1", [hex: :accept, repo: "hexpm", optional: false]}, {:plug, "~> 1.0", [hex: :plug, repo: "hexpm", optional: false]}, {:prometheus_ex, "~> 1.1 or ~> 2.0 or ~> 3.0", [hex: :prometheus_ex, repo: "hexpm", optional: false]}, {:prometheus_process_collector, "~> 1.1", [hex: :prometheus_process_collector, repo: "hexpm", optional: true]}], "hexpm", "0273a6483ccb936d79ca19b0ab629aef0dba958697c94782bb728b920dfc6a79"},
   "quack": {:hex, :quack, "0.1.1", "cca7b4da1a233757fdb44b3334fce80c94785b3ad5a602053b7a002b5a8967bf", [:mix], [{:poison, ">= 1.0.0", [hex: :poison, repo: "hexpm", optional: false]}, {:tesla, "~> 1.2.0", [hex: :tesla, repo: "hexpm", optional: false]}], "hexpm", "d736bfa7444112eb840027bb887832a0e403a4a3437f48028c3b29a2dbbd2543"},
   "ranch": {:hex, :ranch, "1.7.1", "6b1fab51b49196860b733a49c07604465a47bdb78aa10c1c16a3d199f7f8c881", [:rebar3], [], "hexpm", "451d8527787df716d99dc36162fca05934915db0b6141bbdac2ea8d3c7afc7d7"},