From d704aec0505f2ad67bf7568af1af77f0a3545be7 Mon Sep 17 00:00:00 2001 From: Nick Dichev Date: Mon, 30 May 2022 17:00:33 -0700 Subject: [PATCH 1/5] Add endpoint as a tag on HTTP events --- lib/prom_ex/plugins/phoenix.ex | 83 ++++--- test/support/metrics/phoenix.txt | 192 +++++++-------- test/support/metrics/phoenix_multi_router.txt | 232 +++++++++--------- 3 files changed, 255 insertions(+), 252 deletions(-) diff --git a/lib/prom_ex/plugins/phoenix.ex b/lib/prom_ex/plugins/phoenix.ex index c0c0e618..5dff21d2 100644 --- a/lib/prom_ex/plugins/phoenix.ex +++ b/lib/prom_ex/plugins/phoenix.ex @@ -149,6 +149,8 @@ if Code.ensure_loaded?(Phoenix) do @stop_event [:prom_ex, :plugin, :phoenix, :stop] + @unknown_value "Unknown" + @impl true def event_metrics(opts) do otp_app = Keyword.fetch!(opts, :otp_app) @@ -243,7 +245,7 @@ if Code.ensure_loaded?(Phoenix) do defp http_events(metric_prefix, opts) do routers = fetch_routers!(opts) additional_routes = fetch_additional_routes!(opts) - http_metrics_tags = [:status, :method, :path, :controller, :action] + http_metrics_tags = [:endpoint, :status, :method, :path, :controller, :action] Event.build( :phoenix_http_event_metrics, @@ -363,21 +365,10 @@ if Code.ensure_loaded?(Phoenix) do defp get_conn_tags(routers, []) do fn %{conn: %Conn{} = conn} -> - default_route_tags = %{ - path: "Unknown", - controller: "Unknown", - action: "Unknown" - } - - conn - |> do_get_router_info(routers, default_route_tags) - |> Map.merge(%{ - status: conn.status, - method: conn.method - }) + merge_conn_tags(conn, routers, default_route_tags()) _ -> - Logger.warning("Could not resolve path for request") + Logger.warning("Could not resolve tags for request") end end @@ -385,20 +376,37 @@ if Code.ensure_loaded?(Phoenix) do fn %{conn: %Conn{} = conn} -> default_route_tags = handle_additional_routes_check(conn, additional_routes) + merge_conn_tags(conn, routers, default_route_tags) + + _ -> + Logger.warning("Could not resolve tags for request") + end + end + + defp merge_conn_tags(conn, routers, default_route_tags) do + endpoint_tags = do_get_endpoint_tags(conn) + router_tags = do_get_router_tags(conn, routers, default_route_tags) + + default_route_tags + |> Map.merge(endpoint_tags) + |> Map.merge(router_tags) + |> Map.merge(%{status: conn.status, method: conn.method}) + end + + defp do_get_endpoint_tags(conn) do + case conn do + %{private: %{phoenix_endpoint: endpoint}} -> + %{endpoint: normalize_module_name(endpoint)} - conn - |> do_get_router_info(routers, default_route_tags) - |> Map.merge(%{ - status: conn.status, - method: conn.method - }) + %{socket: %{endpoint: endpoint}} -> + %{endpoint: normalize_module_name(endpoint)} _ -> - Logger.warning("Could not resolve path for request") + %{} end end - defp do_get_router_info(conn, routers, default_route_tags) do + defp do_get_router_tags(conn, routers, default_route_tags) do routers |> Enum.find_value(default_route_tags, fn router -> case Phoenix.Router.route_info(router, conn.method, conn.request_path, "") do @@ -416,28 +424,14 @@ if Code.ensure_loaded?(Phoenix) do end defp handle_additional_routes_check(%Conn{request_path: request_path}, additional_routes) do - default_tags = %{ - path: "Unknown", - controller: "Unknown", - action: "Unknown" - } - additional_routes - |> Enum.find_value(default_tags, fn {path_label, route_check} -> + |> Enum.find_value(default_route_tags(), fn {path_label, route_check} -> cond do is_binary(route_check) and route_check == request_path -> - %{ - path: path_label, - controller: "NA", - action: "NA" - } + default_route_tags(path: path_label, controller: "NA", action: "NA") match?(%Regex{}, route_check) and Regex.match?(route_check, request_path) -> - %{ - path: path_label, - controller: "NA", - action: "NA" - } + default_route_tags(path: path_label, controller: "NA", action: "NA") true -> false @@ -445,6 +439,15 @@ if Code.ensure_loaded?(Phoenix) do end) end + defp default_route_tags(opts \\ []) do + %{ + path: Keyword.get(opts, :path, @unknown_value), + controller: Keyword.get(opts, :controller, @unknown_value), + action: Keyword.get(opts, :action, @unknown_value), + endpoint: Keyword.get(opts, :endpoint, @unknown_value) + } + end + defp set_up_telemetry_proxy(phoenix_event_prefixes) do phoenix_event_prefixes |> Enum.each(fn telemetry_prefix -> @@ -473,7 +476,7 @@ if Code.ensure_loaded?(Phoenix) do defp normalize_module_name(name), do: name defp normalize_action(action) when is_atom(action), do: action - defp normalize_action(_action), do: "Unknown" + defp normalize_action(_action), do: @unknown_value defp fetch_additional_routes!(opts) do opts diff --git a/test/support/metrics/phoenix.txt b/test/support/metrics/phoenix.txt index cfe459b1..1f6fe500 100644 --- a/test/support/metrics/phoenix.txt +++ b/test/support/metrics/phoenix.txt @@ -1,100 +1,100 @@ -# HELP web_app_prom_ex_prom_ex_status_info Information regarding the PromEx library. Primarily used as a source of truth for Prometheus default labels. -# TYPE web_app_prom_ex_prom_ex_status_info gauge -web_app_prom_ex_prom_ex_status_info 1 # HELP web_app_prom_ex_phoenix_channel_joined_total The number of channel joins that have occurred. -# TYPE web_app_prom_ex_phoenix_channel_joined_total counter -web_app_prom_ex_phoenix_channel_joined_total{endpoint="WebAppWeb.Endpoint",result="ok",transport="websocket"} 17 +# HELP web_app_prom_ex_phoenix_http_request_duration_milliseconds The time it takes for the application to respond to HTTP requests. # HELP web_app_prom_ex_phoenix_http_requests_total The number of requests have been serviced. -# TYPE web_app_prom_ex_phoenix_http_requests_total counter -web_app_prom_ex_phoenix_http_requests_total{action="index",controller="Phoenix.LiveView.Plug",method="GET",path="/",status="500"} 2 -web_app_prom_ex_phoenix_http_requests_total{action="NA",controller="NA",method="GET",path="special_label",status="200"} 5 -web_app_prom_ex_phoenix_http_requests_total{action="NA",controller="NA",method="GET",path="another_label",status="200"} 5 -web_app_prom_ex_phoenix_http_requests_total{action="index",controller="Phoenix.LiveView.Plug",method="GET",path="/",status="200"} 8 # HELP web_app_prom_ex_phoenix_http_response_size_bytes The size of the HTTP response payload. -# TYPE web_app_prom_ex_phoenix_http_response_size_bytes histogram -web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="index",controller="Phoenix.LiveView.Plug",method="GET",path="/",status="500",le="64"} 0 -web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="index",controller="Phoenix.LiveView.Plug",method="GET",path="/",status="500",le="512"} 0 -web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="index",controller="Phoenix.LiveView.Plug",method="GET",path="/",status="500",le="4096"} 0 -web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="index",controller="Phoenix.LiveView.Plug",method="GET",path="/",status="500",le="65536"} 0 -web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="index",controller="Phoenix.LiveView.Plug",method="GET",path="/",status="500",le="262144"} 2 -web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="index",controller="Phoenix.LiveView.Plug",method="GET",path="/",status="500",le="1048576"} 2 -web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="index",controller="Phoenix.LiveView.Plug",method="GET",path="/",status="500",le="4194304"} 2 -web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="index",controller="Phoenix.LiveView.Plug",method="GET",path="/",status="500",le="16777216"} 2 -web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="index",controller="Phoenix.LiveView.Plug",method="GET",path="/",status="500",le="+Inf"} 2 -web_app_prom_ex_phoenix_http_response_size_bytes_sum{action="index",controller="Phoenix.LiveView.Plug",method="GET",path="/",status="500"} 141644 -web_app_prom_ex_phoenix_http_response_size_bytes_count{action="index",controller="Phoenix.LiveView.Plug",method="GET",path="/",status="500"} 2 -web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="index",controller="Phoenix.LiveView.Plug",method="GET",path="/",status="200",le="64"} 0 -web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="index",controller="Phoenix.LiveView.Plug",method="GET",path="/",status="200",le="512"} 0 -web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="index",controller="Phoenix.LiveView.Plug",method="GET",path="/",status="200",le="4096"} 8 -web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="index",controller="Phoenix.LiveView.Plug",method="GET",path="/",status="200",le="65536"} 8 -web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="index",controller="Phoenix.LiveView.Plug",method="GET",path="/",status="200",le="262144"} 8 -web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="index",controller="Phoenix.LiveView.Plug",method="GET",path="/",status="200",le="1048576"} 8 -web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="index",controller="Phoenix.LiveView.Plug",method="GET",path="/",status="200",le="4194304"} 8 -web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="index",controller="Phoenix.LiveView.Plug",method="GET",path="/",status="200",le="16777216"} 8 -web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="index",controller="Phoenix.LiveView.Plug",method="GET",path="/",status="200",le="+Inf"} 8 -web_app_prom_ex_phoenix_http_response_size_bytes_sum{action="index",controller="Phoenix.LiveView.Plug",method="GET",path="/",status="200"} 26656 -web_app_prom_ex_phoenix_http_response_size_bytes_count{action="index",controller="Phoenix.LiveView.Plug",method="GET",path="/",status="200"} 8 -web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="NA",controller="NA",method="GET",path="another_label",status="200",le="64"} 5 -web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="NA",controller="NA",method="GET",path="another_label",status="200",le="512"} 5 -web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="NA",controller="NA",method="GET",path="another_label",status="200",le="4096"} 5 -web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="NA",controller="NA",method="GET",path="another_label",status="200",le="65536"} 5 -web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="NA",controller="NA",method="GET",path="another_label",status="200",le="262144"} 5 -web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="NA",controller="NA",method="GET",path="another_label",status="200",le="1048576"} 5 -web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="NA",controller="NA",method="GET",path="another_label",status="200",le="4194304"} 5 -web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="NA",controller="NA",method="GET",path="another_label",status="200",le="16777216"} 5 -web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="NA",controller="NA",method="GET",path="another_label",status="200",le="+Inf"} 5 -web_app_prom_ex_phoenix_http_response_size_bytes_sum{action="NA",controller="NA",method="GET",path="another_label",status="200"} 35 -web_app_prom_ex_phoenix_http_response_size_bytes_count{action="NA",controller="NA",method="GET",path="another_label",status="200"} 5 -web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="NA",controller="NA",method="GET",path="special_label",status="200",le="64"} 5 -web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="NA",controller="NA",method="GET",path="special_label",status="200",le="512"} 5 -web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="NA",controller="NA",method="GET",path="special_label",status="200",le="4096"} 5 -web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="NA",controller="NA",method="GET",path="special_label",status="200",le="65536"} 5 -web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="NA",controller="NA",method="GET",path="special_label",status="200",le="262144"} 5 -web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="NA",controller="NA",method="GET",path="special_label",status="200",le="1048576"} 5 -web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="NA",controller="NA",method="GET",path="special_label",status="200",le="4194304"} 5 -web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="NA",controller="NA",method="GET",path="special_label",status="200",le="16777216"} 5 -web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="NA",controller="NA",method="GET",path="special_label",status="200",le="+Inf"} 5 -web_app_prom_ex_phoenix_http_response_size_bytes_sum{action="NA",controller="NA",method="GET",path="special_label",status="200"} 40 -web_app_prom_ex_phoenix_http_response_size_bytes_count{action="NA",controller="NA",method="GET",path="special_label",status="200"} 5 -# HELP web_app_prom_ex_phoenix_http_request_duration_milliseconds The time it takes for the application to respond to HTTP requests. +# HELP web_app_prom_ex_prom_ex_status_info Information regarding the PromEx library. Primarily used as a source of truth for Prometheus default labels. +# TYPE web_app_prom_ex_phoenix_channel_joined_total counter # TYPE web_app_prom_ex_phoenix_http_request_duration_milliseconds histogram -web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="index",controller="Phoenix.LiveView.Plug",method="GET",path="/",status="200",le="10"} 0 -web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="index",controller="Phoenix.LiveView.Plug",method="GET",path="/",status="200",le="100"} 0 -web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="index",controller="Phoenix.LiveView.Plug",method="GET",path="/",status="200",le="500"} 7 -web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="index",controller="Phoenix.LiveView.Plug",method="GET",path="/",status="200",le="1000"} 8 -web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="index",controller="Phoenix.LiveView.Plug",method="GET",path="/",status="200",le="5000"} 8 -web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="index",controller="Phoenix.LiveView.Plug",method="GET",path="/",status="200",le="10000"} 8 -web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="index",controller="Phoenix.LiveView.Plug",method="GET",path="/",status="200",le="30000"} 8 -web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="index",controller="Phoenix.LiveView.Plug",method="GET",path="/",status="200",le="+Inf"} 8 -web_app_prom_ex_phoenix_http_request_duration_milliseconds_sum{action="index",controller="Phoenix.LiveView.Plug",method="GET",path="/",status="200"} 2636.8795279999995 -web_app_prom_ex_phoenix_http_request_duration_milliseconds_count{action="index",controller="Phoenix.LiveView.Plug",method="GET",path="/",status="200"} 8 -web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="index",controller="Phoenix.LiveView.Plug",method="GET",path="/",status="500",le="10"} 1 -web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="index",controller="Phoenix.LiveView.Plug",method="GET",path="/",status="500",le="100"} 2 -web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="index",controller="Phoenix.LiveView.Plug",method="GET",path="/",status="500",le="500"} 2 -web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="index",controller="Phoenix.LiveView.Plug",method="GET",path="/",status="500",le="1000"} 2 -web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="index",controller="Phoenix.LiveView.Plug",method="GET",path="/",status="500",le="5000"} 2 -web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="index",controller="Phoenix.LiveView.Plug",method="GET",path="/",status="500",le="10000"} 2 -web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="index",controller="Phoenix.LiveView.Plug",method="GET",path="/",status="500",le="30000"} 2 -web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="index",controller="Phoenix.LiveView.Plug",method="GET",path="/",status="500",le="+Inf"} 2 -web_app_prom_ex_phoenix_http_request_duration_milliseconds_sum{action="index",controller="Phoenix.LiveView.Plug",method="GET",path="/",status="500"} 17.342053 -web_app_prom_ex_phoenix_http_request_duration_milliseconds_count{action="index",controller="Phoenix.LiveView.Plug",method="GET",path="/",status="500"} 2 -web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="NA",controller="NA",method="GET",path="special_label",status="200",le="10"} 5 -web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="NA",controller="NA",method="GET",path="special_label",status="200",le="100"} 5 -web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="NA",controller="NA",method="GET",path="special_label",status="200",le="500"} 5 -web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="NA",controller="NA",method="GET",path="special_label",status="200",le="1000"} 5 -web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="NA",controller="NA",method="GET",path="special_label",status="200",le="5000"} 5 -web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="NA",controller="NA",method="GET",path="special_label",status="200",le="10000"} 5 -web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="NA",controller="NA",method="GET",path="special_label",status="200",le="30000"} 5 -web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="NA",controller="NA",method="GET",path="special_label",status="200",le="+Inf"} 5 -web_app_prom_ex_phoenix_http_request_duration_milliseconds_sum{action="NA",controller="NA",method="GET",path="special_label",status="200"} 0.215255 -web_app_prom_ex_phoenix_http_request_duration_milliseconds_count{action="NA",controller="NA",method="GET",path="special_label",status="200"} 5 -web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="NA",controller="NA",method="GET",path="another_label",status="200",le="10"} 5 -web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="NA",controller="NA",method="GET",path="another_label",status="200",le="100"} 5 -web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="NA",controller="NA",method="GET",path="another_label",status="200",le="500"} 5 -web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="NA",controller="NA",method="GET",path="another_label",status="200",le="1000"} 5 -web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="NA",controller="NA",method="GET",path="another_label",status="200",le="5000"} 5 -web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="NA",controller="NA",method="GET",path="another_label",status="200",le="10000"} 5 -web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="NA",controller="NA",method="GET",path="another_label",status="200",le="30000"} 5 -web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="NA",controller="NA",method="GET",path="another_label",status="200",le="+Inf"} 5 -web_app_prom_ex_phoenix_http_request_duration_milliseconds_sum{action="NA",controller="NA",method="GET",path="another_label",status="200"} 0.246272 -web_app_prom_ex_phoenix_http_request_duration_milliseconds_count{action="NA",controller="NA",method="GET",path="another_label",status="200"} 5 +# TYPE web_app_prom_ex_phoenix_http_requests_total counter +# TYPE web_app_prom_ex_phoenix_http_response_size_bytes histogram +# TYPE web_app_prom_ex_prom_ex_status_info gauge +web_app_prom_ex_phoenix_channel_joined_total{endpoint="WebAppWeb.Endpoint",result="ok",transport="websocket"} 17 +web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="NA",controller="NA",endpoint="Unknown",method="GET",path="another_label",status="200",le="+Inf"} 5 +web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="NA",controller="NA",endpoint="Unknown",method="GET",path="another_label",status="200",le="10"} 5 +web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="NA",controller="NA",endpoint="Unknown",method="GET",path="another_label",status="200",le="100"} 5 +web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="NA",controller="NA",endpoint="Unknown",method="GET",path="another_label",status="200",le="1000"} 5 +web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="NA",controller="NA",endpoint="Unknown",method="GET",path="another_label",status="200",le="10000"} 5 +web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="NA",controller="NA",endpoint="Unknown",method="GET",path="another_label",status="200",le="30000"} 5 +web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="NA",controller="NA",endpoint="Unknown",method="GET",path="another_label",status="200",le="500"} 5 +web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="NA",controller="NA",endpoint="Unknown",method="GET",path="another_label",status="200",le="5000"} 5 +web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="NA",controller="NA",endpoint="Unknown",method="GET",path="special_label",status="200",le="+Inf"} 5 +web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="NA",controller="NA",endpoint="Unknown",method="GET",path="special_label",status="200",le="10"} 5 +web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="NA",controller="NA",endpoint="Unknown",method="GET",path="special_label",status="200",le="100"} 5 +web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="NA",controller="NA",endpoint="Unknown",method="GET",path="special_label",status="200",le="1000"} 5 +web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="NA",controller="NA",endpoint="Unknown",method="GET",path="special_label",status="200",le="10000"} 5 +web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="NA",controller="NA",endpoint="Unknown",method="GET",path="special_label",status="200",le="30000"} 5 +web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="NA",controller="NA",endpoint="Unknown",method="GET",path="special_label",status="200",le="500"} 5 +web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="NA",controller="NA",endpoint="Unknown",method="GET",path="special_label",status="200",le="5000"} 5 +web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="index",controller="Phoenix.LiveView.Plug",endpoint="WebAppWeb.Endpoint",method="GET",path="/",status="200",le="+Inf"} 8 +web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="index",controller="Phoenix.LiveView.Plug",endpoint="WebAppWeb.Endpoint",method="GET",path="/",status="200",le="10"} 0 +web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="index",controller="Phoenix.LiveView.Plug",endpoint="WebAppWeb.Endpoint",method="GET",path="/",status="200",le="100"} 0 +web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="index",controller="Phoenix.LiveView.Plug",endpoint="WebAppWeb.Endpoint",method="GET",path="/",status="200",le="1000"} 8 +web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="index",controller="Phoenix.LiveView.Plug",endpoint="WebAppWeb.Endpoint",method="GET",path="/",status="200",le="10000"} 8 +web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="index",controller="Phoenix.LiveView.Plug",endpoint="WebAppWeb.Endpoint",method="GET",path="/",status="200",le="30000"} 8 +web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="index",controller="Phoenix.LiveView.Plug",endpoint="WebAppWeb.Endpoint",method="GET",path="/",status="200",le="500"} 7 +web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="index",controller="Phoenix.LiveView.Plug",endpoint="WebAppWeb.Endpoint",method="GET",path="/",status="200",le="5000"} 8 +web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="index",controller="Phoenix.LiveView.Plug",endpoint="WebAppWeb.Endpoint",method="GET",path="/",status="500",le="+Inf"} 2 +web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="index",controller="Phoenix.LiveView.Plug",endpoint="WebAppWeb.Endpoint",method="GET",path="/",status="500",le="10"} 1 +web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="index",controller="Phoenix.LiveView.Plug",endpoint="WebAppWeb.Endpoint",method="GET",path="/",status="500",le="100"} 2 +web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="index",controller="Phoenix.LiveView.Plug",endpoint="WebAppWeb.Endpoint",method="GET",path="/",status="500",le="1000"} 2 +web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="index",controller="Phoenix.LiveView.Plug",endpoint="WebAppWeb.Endpoint",method="GET",path="/",status="500",le="10000"} 2 +web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="index",controller="Phoenix.LiveView.Plug",endpoint="WebAppWeb.Endpoint",method="GET",path="/",status="500",le="30000"} 2 +web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="index",controller="Phoenix.LiveView.Plug",endpoint="WebAppWeb.Endpoint",method="GET",path="/",status="500",le="500"} 2 +web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="index",controller="Phoenix.LiveView.Plug",endpoint="WebAppWeb.Endpoint",method="GET",path="/",status="500",le="5000"} 2 +web_app_prom_ex_phoenix_http_request_duration_milliseconds_count{action="NA",controller="NA",endpoint="Unknown",method="GET",path="another_label",status="200"} 5 +web_app_prom_ex_phoenix_http_request_duration_milliseconds_count{action="NA",controller="NA",endpoint="Unknown",method="GET",path="special_label",status="200"} 5 +web_app_prom_ex_phoenix_http_request_duration_milliseconds_count{action="index",controller="Phoenix.LiveView.Plug",endpoint="WebAppWeb.Endpoint",method="GET",path="/",status="200"} 8 +web_app_prom_ex_phoenix_http_request_duration_milliseconds_count{action="index",controller="Phoenix.LiveView.Plug",endpoint="WebAppWeb.Endpoint",method="GET",path="/",status="500"} 2 +web_app_prom_ex_phoenix_http_request_duration_milliseconds_sum{action="NA",controller="NA",endpoint="Unknown",method="GET",path="another_label",status="200"} 0.246272 +web_app_prom_ex_phoenix_http_request_duration_milliseconds_sum{action="NA",controller="NA",endpoint="Unknown",method="GET",path="special_label",status="200"} 0.215255 +web_app_prom_ex_phoenix_http_request_duration_milliseconds_sum{action="index",controller="Phoenix.LiveView.Plug",endpoint="WebAppWeb.Endpoint",method="GET",path="/",status="200"} 2636.8795279999995 +web_app_prom_ex_phoenix_http_request_duration_milliseconds_sum{action="index",controller="Phoenix.LiveView.Plug",endpoint="WebAppWeb.Endpoint",method="GET",path="/",status="500"} 17.342053 +web_app_prom_ex_phoenix_http_requests_total{action="NA",controller="NA",endpoint="Unknown",method="GET",path="another_label",status="200"} 5 +web_app_prom_ex_phoenix_http_requests_total{action="NA",controller="NA",endpoint="Unknown",method="GET",path="special_label",status="200"} 5 +web_app_prom_ex_phoenix_http_requests_total{action="index",controller="Phoenix.LiveView.Plug",endpoint="WebAppWeb.Endpoint",method="GET",path="/",status="200"} 8 +web_app_prom_ex_phoenix_http_requests_total{action="index",controller="Phoenix.LiveView.Plug",endpoint="WebAppWeb.Endpoint",method="GET",path="/",status="500"} 2 +web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="NA",controller="NA",endpoint="Unknown",method="GET",path="another_label",status="200",le="+Inf"} 5 +web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="NA",controller="NA",endpoint="Unknown",method="GET",path="another_label",status="200",le="1048576"} 5 +web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="NA",controller="NA",endpoint="Unknown",method="GET",path="another_label",status="200",le="16777216"} 5 +web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="NA",controller="NA",endpoint="Unknown",method="GET",path="another_label",status="200",le="262144"} 5 +web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="NA",controller="NA",endpoint="Unknown",method="GET",path="another_label",status="200",le="4096"} 5 +web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="NA",controller="NA",endpoint="Unknown",method="GET",path="another_label",status="200",le="4194304"} 5 +web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="NA",controller="NA",endpoint="Unknown",method="GET",path="another_label",status="200",le="512"} 5 +web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="NA",controller="NA",endpoint="Unknown",method="GET",path="another_label",status="200",le="64"} 5 +web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="NA",controller="NA",endpoint="Unknown",method="GET",path="another_label",status="200",le="65536"} 5 +web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="NA",controller="NA",endpoint="Unknown",method="GET",path="special_label",status="200",le="+Inf"} 5 +web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="NA",controller="NA",endpoint="Unknown",method="GET",path="special_label",status="200",le="1048576"} 5 +web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="NA",controller="NA",endpoint="Unknown",method="GET",path="special_label",status="200",le="16777216"} 5 +web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="NA",controller="NA",endpoint="Unknown",method="GET",path="special_label",status="200",le="262144"} 5 +web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="NA",controller="NA",endpoint="Unknown",method="GET",path="special_label",status="200",le="4096"} 5 +web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="NA",controller="NA",endpoint="Unknown",method="GET",path="special_label",status="200",le="4194304"} 5 +web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="NA",controller="NA",endpoint="Unknown",method="GET",path="special_label",status="200",le="512"} 5 +web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="NA",controller="NA",endpoint="Unknown",method="GET",path="special_label",status="200",le="64"} 5 +web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="NA",controller="NA",endpoint="Unknown",method="GET",path="special_label",status="200",le="65536"} 5 +web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="index",controller="Phoenix.LiveView.Plug",endpoint="WebAppWeb.Endpoint",method="GET",path="/",status="200",le="+Inf"} 8 +web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="index",controller="Phoenix.LiveView.Plug",endpoint="WebAppWeb.Endpoint",method="GET",path="/",status="200",le="1048576"} 8 +web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="index",controller="Phoenix.LiveView.Plug",endpoint="WebAppWeb.Endpoint",method="GET",path="/",status="200",le="16777216"} 8 +web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="index",controller="Phoenix.LiveView.Plug",endpoint="WebAppWeb.Endpoint",method="GET",path="/",status="200",le="262144"} 8 +web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="index",controller="Phoenix.LiveView.Plug",endpoint="WebAppWeb.Endpoint",method="GET",path="/",status="200",le="4096"} 8 +web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="index",controller="Phoenix.LiveView.Plug",endpoint="WebAppWeb.Endpoint",method="GET",path="/",status="200",le="4194304"} 8 +web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="index",controller="Phoenix.LiveView.Plug",endpoint="WebAppWeb.Endpoint",method="GET",path="/",status="200",le="512"} 0 +web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="index",controller="Phoenix.LiveView.Plug",endpoint="WebAppWeb.Endpoint",method="GET",path="/",status="200",le="64"} 0 +web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="index",controller="Phoenix.LiveView.Plug",endpoint="WebAppWeb.Endpoint",method="GET",path="/",status="200",le="65536"} 8 +web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="index",controller="Phoenix.LiveView.Plug",endpoint="WebAppWeb.Endpoint",method="GET",path="/",status="500",le="+Inf"} 2 +web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="index",controller="Phoenix.LiveView.Plug",endpoint="WebAppWeb.Endpoint",method="GET",path="/",status="500",le="1048576"} 2 +web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="index",controller="Phoenix.LiveView.Plug",endpoint="WebAppWeb.Endpoint",method="GET",path="/",status="500",le="16777216"} 2 +web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="index",controller="Phoenix.LiveView.Plug",endpoint="WebAppWeb.Endpoint",method="GET",path="/",status="500",le="262144"} 2 +web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="index",controller="Phoenix.LiveView.Plug",endpoint="WebAppWeb.Endpoint",method="GET",path="/",status="500",le="4096"} 0 +web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="index",controller="Phoenix.LiveView.Plug",endpoint="WebAppWeb.Endpoint",method="GET",path="/",status="500",le="4194304"} 2 +web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="index",controller="Phoenix.LiveView.Plug",endpoint="WebAppWeb.Endpoint",method="GET",path="/",status="500",le="512"} 0 +web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="index",controller="Phoenix.LiveView.Plug",endpoint="WebAppWeb.Endpoint",method="GET",path="/",status="500",le="64"} 0 +web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="index",controller="Phoenix.LiveView.Plug",endpoint="WebAppWeb.Endpoint",method="GET",path="/",status="500",le="65536"} 0 +web_app_prom_ex_phoenix_http_response_size_bytes_count{action="NA",controller="NA",endpoint="Unknown",method="GET",path="another_label",status="200"} 5 +web_app_prom_ex_phoenix_http_response_size_bytes_count{action="NA",controller="NA",endpoint="Unknown",method="GET",path="special_label",status="200"} 5 +web_app_prom_ex_phoenix_http_response_size_bytes_count{action="index",controller="Phoenix.LiveView.Plug",endpoint="WebAppWeb.Endpoint",method="GET",path="/",status="200"} 8 +web_app_prom_ex_phoenix_http_response_size_bytes_count{action="index",controller="Phoenix.LiveView.Plug",endpoint="WebAppWeb.Endpoint",method="GET",path="/",status="500"} 2 +web_app_prom_ex_phoenix_http_response_size_bytes_sum{action="NA",controller="NA",endpoint="Unknown",method="GET",path="another_label",status="200"} 35 +web_app_prom_ex_phoenix_http_response_size_bytes_sum{action="NA",controller="NA",endpoint="Unknown",method="GET",path="special_label",status="200"} 40 +web_app_prom_ex_phoenix_http_response_size_bytes_sum{action="index",controller="Phoenix.LiveView.Plug",endpoint="WebAppWeb.Endpoint",method="GET",path="/",status="200"} 26656 +web_app_prom_ex_phoenix_http_response_size_bytes_sum{action="index",controller="Phoenix.LiveView.Plug",endpoint="WebAppWeb.Endpoint",method="GET",path="/",status="500"} 141644 +web_app_prom_ex_prom_ex_status_info 1 diff --git a/test/support/metrics/phoenix_multi_router.txt b/test/support/metrics/phoenix_multi_router.txt index 91e2cb0d..e6119b02 100644 --- a/test/support/metrics/phoenix_multi_router.txt +++ b/test/support/metrics/phoenix_multi_router.txt @@ -1,119 +1,119 @@ -# HELP web_app_prom_ex_prom_ex_status_info Information regarding the PromEx library. Primarily used as a source of truth for Prometheus default labels. -# TYPE web_app_prom_ex_prom_ex_status_info gauge -web_app_prom_ex_prom_ex_status_info 1 +# HELP web_app_prom_ex_phoenix_http_request_duration_milliseconds The time it takes for the application to respond to HTTP requests. # HELP web_app_prom_ex_phoenix_http_requests_total The number of requests have been serviced. -# TYPE web_app_prom_ex_phoenix_http_requests_total counter -web_app_prom_ex_phoenix_http_requests_total{action="index",controller="TestApp.UserController",method="GET",path="/external/users",status="500"} 1 -web_app_prom_ex_phoenix_http_requests_total{action="NA",controller="NA",method="GET",path="special_label",status="200"} 2 -web_app_prom_ex_phoenix_http_requests_total{action="index",controller="TestApp.UserController",method="GET",path="/internal/users",status="200"} 2 -web_app_prom_ex_phoenix_http_requests_total{action="index",controller="TestApp.UserController",method="GET",path="/external/users",status="200"} 1 -web_app_prom_ex_phoenix_http_requests_total{action="NA",controller="NA",method="GET",path="another_label",status="200"} 1 # HELP web_app_prom_ex_phoenix_http_response_size_bytes The size of the HTTP response payload. -# TYPE web_app_prom_ex_phoenix_http_response_size_bytes histogram -web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="NA",controller="NA",method="GET",path="another_label",status="200",le="64"} 1 -web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="NA",controller="NA",method="GET",path="another_label",status="200",le="512"} 1 -web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="NA",controller="NA",method="GET",path="another_label",status="200",le="4096"} 1 -web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="NA",controller="NA",method="GET",path="another_label",status="200",le="65536"} 1 -web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="NA",controller="NA",method="GET",path="another_label",status="200",le="262144"} 1 -web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="NA",controller="NA",method="GET",path="another_label",status="200",le="1048576"} 1 -web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="NA",controller="NA",method="GET",path="another_label",status="200",le="4194304"} 1 -web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="NA",controller="NA",method="GET",path="another_label",status="200",le="16777216"} 1 -web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="NA",controller="NA",method="GET",path="another_label",status="200",le="+Inf"} 1 -web_app_prom_ex_phoenix_http_response_size_bytes_sum{action="NA",controller="NA",method="GET",path="another_label",status="200"} 7 -web_app_prom_ex_phoenix_http_response_size_bytes_count{action="NA",controller="NA",method="GET",path="another_label",status="200"} 1 -web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="index",controller="TestApp.UserController",method="GET",path="/external/users",status="200",le="64"} 0 -web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="index",controller="TestApp.UserController",method="GET",path="/external/users",status="200",le="512"} 0 -web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="index",controller="TestApp.UserController",method="GET",path="/external/users",status="200",le="4096"} 1 -web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="index",controller="TestApp.UserController",method="GET",path="/external/users",status="200",le="65536"} 1 -web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="index",controller="TestApp.UserController",method="GET",path="/external/users",status="200",le="262144"} 1 -web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="index",controller="TestApp.UserController",method="GET",path="/external/users",status="200",le="1048576"} 1 -web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="index",controller="TestApp.UserController",method="GET",path="/external/users",status="200",le="4194304"} 1 -web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="index",controller="TestApp.UserController",method="GET",path="/external/users",status="200",le="16777216"} 1 -web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="index",controller="TestApp.UserController",method="GET",path="/external/users",status="200",le="+Inf"} 1 -web_app_prom_ex_phoenix_http_response_size_bytes_sum{action="index",controller="TestApp.UserController",method="GET",path="/external/users",status="200"} 3332 -web_app_prom_ex_phoenix_http_response_size_bytes_count{action="index",controller="TestApp.UserController",method="GET",path="/external/users",status="200"} 1 -web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="index",controller="TestApp.UserController",method="GET",path="/internal/users",status="200",le="64"} 0 -web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="index",controller="TestApp.UserController",method="GET",path="/internal/users",status="200",le="512"} 0 -web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="index",controller="TestApp.UserController",method="GET",path="/internal/users",status="200",le="4096"} 2 -web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="index",controller="TestApp.UserController",method="GET",path="/internal/users",status="200",le="65536"} 2 -web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="index",controller="TestApp.UserController",method="GET",path="/internal/users",status="200",le="262144"} 2 -web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="index",controller="TestApp.UserController",method="GET",path="/internal/users",status="200",le="1048576"} 2 -web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="index",controller="TestApp.UserController",method="GET",path="/internal/users",status="200",le="4194304"} 2 -web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="index",controller="TestApp.UserController",method="GET",path="/internal/users",status="200",le="16777216"} 2 -web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="index",controller="TestApp.UserController",method="GET",path="/internal/users",status="200",le="+Inf"} 2 -web_app_prom_ex_phoenix_http_response_size_bytes_sum{action="index",controller="TestApp.UserController",method="GET",path="/internal/users",status="200"} 6664 -web_app_prom_ex_phoenix_http_response_size_bytes_count{action="index",controller="TestApp.UserController",method="GET",path="/internal/users",status="200"} 2 -web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="index",controller="TestApp.UserController",method="GET",path="/external/users",status="500",le="64"} 0 -web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="index",controller="TestApp.UserController",method="GET",path="/external/users",status="500",le="512"} 0 -web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="index",controller="TestApp.UserController",method="GET",path="/external/users",status="500",le="4096"} 0 -web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="index",controller="TestApp.UserController",method="GET",path="/external/users",status="500",le="65536"} 0 -web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="index",controller="TestApp.UserController",method="GET",path="/external/users",status="500",le="262144"} 1 -web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="index",controller="TestApp.UserController",method="GET",path="/external/users",status="500",le="1048576"} 1 -web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="index",controller="TestApp.UserController",method="GET",path="/external/users",status="500",le="4194304"} 1 -web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="index",controller="TestApp.UserController",method="GET",path="/external/users",status="500",le="16777216"} 1 -web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="index",controller="TestApp.UserController",method="GET",path="/external/users",status="500",le="+Inf"} 1 -web_app_prom_ex_phoenix_http_response_size_bytes_sum{action="index",controller="TestApp.UserController",method="GET",path="/external/users",status="500"} 70822 -web_app_prom_ex_phoenix_http_response_size_bytes_count{action="index",controller="TestApp.UserController",method="GET",path="/external/users",status="500"} 1 -web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="NA",controller="NA",method="GET",path="special_label",status="200",le="64"} 2 -web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="NA",controller="NA",method="GET",path="special_label",status="200",le="512"} 2 -web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="NA",controller="NA",method="GET",path="special_label",status="200",le="4096"} 2 -web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="NA",controller="NA",method="GET",path="special_label",status="200",le="65536"} 2 -web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="NA",controller="NA",method="GET",path="special_label",status="200",le="262144"} 2 -web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="NA",controller="NA",method="GET",path="special_label",status="200",le="1048576"} 2 -web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="NA",controller="NA",method="GET",path="special_label",status="200",le="4194304"} 2 -web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="NA",controller="NA",method="GET",path="special_label",status="200",le="16777216"} 2 -web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="NA",controller="NA",method="GET",path="special_label",status="200",le="+Inf"} 2 -web_app_prom_ex_phoenix_http_response_size_bytes_sum{action="NA",controller="NA",method="GET",path="special_label",status="200"} 16 -web_app_prom_ex_phoenix_http_response_size_bytes_count{action="NA",controller="NA",method="GET",path="special_label",status="200"} 2 -# HELP web_app_prom_ex_phoenix_http_request_duration_milliseconds The time it takes for the application to respond to HTTP requests. +# HELP web_app_prom_ex_prom_ex_status_info Information regarding the PromEx library. Primarily used as a source of truth for Prometheus default labels. # TYPE web_app_prom_ex_phoenix_http_request_duration_milliseconds histogram -web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="index",controller="TestApp.UserController",method="GET",path="/external/users",status="200",le="10"} 0 -web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="index",controller="TestApp.UserController",method="GET",path="/external/users",status="200",le="100"} 0 -web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="index",controller="TestApp.UserController",method="GET",path="/external/users",status="200",le="500"} 1 -web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="index",controller="TestApp.UserController",method="GET",path="/external/users",status="200",le="1000"} 1 -web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="index",controller="TestApp.UserController",method="GET",path="/external/users",status="200",le="5000"} 1 -web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="index",controller="TestApp.UserController",method="GET",path="/external/users",status="200",le="10000"} 1 -web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="index",controller="TestApp.UserController",method="GET",path="/external/users",status="200",le="30000"} 1 -web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="index",controller="TestApp.UserController",method="GET",path="/external/users",status="200",le="+Inf"} 1 -web_app_prom_ex_phoenix_http_request_duration_milliseconds_sum{action="index",controller="TestApp.UserController",method="GET",path="/external/users",status="200"} 335.966925 -web_app_prom_ex_phoenix_http_request_duration_milliseconds_count{action="index",controller="TestApp.UserController",method="GET",path="/external/users",status="200"} 1 -web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="index",controller="TestApp.UserController",method="GET",path="/external/users",status="500",le="10"} 0 -web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="index",controller="TestApp.UserController",method="GET",path="/external/users",status="500",le="100"} 1 -web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="index",controller="TestApp.UserController",method="GET",path="/external/users",status="500",le="500"} 1 -web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="index",controller="TestApp.UserController",method="GET",path="/external/users",status="500",le="1000"} 1 -web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="index",controller="TestApp.UserController",method="GET",path="/external/users",status="500",le="5000"} 1 -web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="index",controller="TestApp.UserController",method="GET",path="/external/users",status="500",le="10000"} 1 -web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="index",controller="TestApp.UserController",method="GET",path="/external/users",status="500",le="30000"} 1 -web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="index",controller="TestApp.UserController",method="GET",path="/external/users",status="500",le="+Inf"} 1 -web_app_prom_ex_phoenix_http_request_duration_milliseconds_sum{action="index",controller="TestApp.UserController",method="GET",path="/external/users",status="500"} 10.729941 -web_app_prom_ex_phoenix_http_request_duration_milliseconds_count{action="index",controller="TestApp.UserController",method="GET",path="/external/users",status="500"} 1 -web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="NA",controller="NA",method="GET",path="special_label",status="200",le="10"} 2 -web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="NA",controller="NA",method="GET",path="special_label",status="200",le="100"} 2 -web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="NA",controller="NA",method="GET",path="special_label",status="200",le="500"} 2 -web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="NA",controller="NA",method="GET",path="special_label",status="200",le="1000"} 2 -web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="NA",controller="NA",method="GET",path="special_label",status="200",le="5000"} 2 -web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="NA",controller="NA",method="GET",path="special_label",status="200",le="10000"} 2 -web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="NA",controller="NA",method="GET",path="special_label",status="200",le="30000"} 2 -web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="NA",controller="NA",method="GET",path="special_label",status="200",le="+Inf"} 2 -web_app_prom_ex_phoenix_http_request_duration_milliseconds_sum{action="NA",controller="NA",method="GET",path="special_label",status="200"} 0.085461 -web_app_prom_ex_phoenix_http_request_duration_milliseconds_count{action="NA",controller="NA",method="GET",path="special_label",status="200"} 2 -web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="index",controller="TestApp.UserController",method="GET",path="/internal/users",status="200",le="10"} 0 -web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="index",controller="TestApp.UserController",method="GET",path="/internal/users",status="200",le="100"} 0 -web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="index",controller="TestApp.UserController",method="GET",path="/internal/users",status="200",le="500"} 2 -web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="index",controller="TestApp.UserController",method="GET",path="/internal/users",status="200",le="1000"} 2 -web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="index",controller="TestApp.UserController",method="GET",path="/internal/users",status="200",le="5000"} 2 -web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="index",controller="TestApp.UserController",method="GET",path="/internal/users",status="200",le="10000"} 2 -web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="index",controller="TestApp.UserController",method="GET",path="/internal/users",status="200",le="30000"} 2 -web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="index",controller="TestApp.UserController",method="GET",path="/internal/users",status="200",le="+Inf"} 2 -web_app_prom_ex_phoenix_http_request_duration_milliseconds_sum{action="index",controller="TestApp.UserController",method="GET",path="/internal/users",status="200"} 619.828049 -web_app_prom_ex_phoenix_http_request_duration_milliseconds_count{action="index",controller="TestApp.UserController",method="GET",path="/internal/users",status="200"} 2 -web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="NA",controller="NA",method="GET",path="another_label",status="200",le="10"} 1 -web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="NA",controller="NA",method="GET",path="another_label",status="200",le="100"} 1 -web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="NA",controller="NA",method="GET",path="another_label",status="200",le="500"} 1 -web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="NA",controller="NA",method="GET",path="another_label",status="200",le="1000"} 1 -web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="NA",controller="NA",method="GET",path="another_label",status="200",le="5000"} 1 -web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="NA",controller="NA",method="GET",path="another_label",status="200",le="10000"} 1 -web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="NA",controller="NA",method="GET",path="another_label",status="200",le="30000"} 1 -web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="NA",controller="NA",method="GET",path="another_label",status="200",le="+Inf"} 1 -web_app_prom_ex_phoenix_http_request_duration_milliseconds_sum{action="NA",controller="NA",method="GET",path="another_label",status="200"} 0.046467 -web_app_prom_ex_phoenix_http_request_duration_milliseconds_count{action="NA",controller="NA",method="GET",path="another_label",status="200"} 1 +# TYPE web_app_prom_ex_phoenix_http_requests_total counter +# TYPE web_app_prom_ex_phoenix_http_response_size_bytes histogram +# TYPE web_app_prom_ex_prom_ex_status_info gauge +web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="NA",controller="NA",endpoint="Unknown",method="GET",path="another_label",status="200",le="+Inf"} 1 +web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="NA",controller="NA",endpoint="Unknown",method="GET",path="another_label",status="200",le="10"} 1 +web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="NA",controller="NA",endpoint="Unknown",method="GET",path="another_label",status="200",le="100"} 1 +web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="NA",controller="NA",endpoint="Unknown",method="GET",path="another_label",status="200",le="1000"} 1 +web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="NA",controller="NA",endpoint="Unknown",method="GET",path="another_label",status="200",le="10000"} 1 +web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="NA",controller="NA",endpoint="Unknown",method="GET",path="another_label",status="200",le="30000"} 1 +web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="NA",controller="NA",endpoint="Unknown",method="GET",path="another_label",status="200",le="500"} 1 +web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="NA",controller="NA",endpoint="Unknown",method="GET",path="another_label",status="200",le="5000"} 1 +web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="NA",controller="NA",endpoint="Unknown",method="GET",path="special_label",status="200",le="+Inf"} 2 +web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="NA",controller="NA",endpoint="Unknown",method="GET",path="special_label",status="200",le="10"} 2 +web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="NA",controller="NA",endpoint="Unknown",method="GET",path="special_label",status="200",le="100"} 2 +web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="NA",controller="NA",endpoint="Unknown",method="GET",path="special_label",status="200",le="1000"} 2 +web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="NA",controller="NA",endpoint="Unknown",method="GET",path="special_label",status="200",le="10000"} 2 +web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="NA",controller="NA",endpoint="Unknown",method="GET",path="special_label",status="200",le="30000"} 2 +web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="NA",controller="NA",endpoint="Unknown",method="GET",path="special_label",status="200",le="500"} 2 +web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="NA",controller="NA",endpoint="Unknown",method="GET",path="special_label",status="200",le="5000"} 2 +web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="index",controller="TestApp.UserController",endpoint="WebAppWeb.Endpoint",method="GET",path="/external/users",status="200",le="+Inf"} 1 +web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="index",controller="TestApp.UserController",endpoint="WebAppWeb.Endpoint",method="GET",path="/external/users",status="200",le="10"} 0 +web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="index",controller="TestApp.UserController",endpoint="WebAppWeb.Endpoint",method="GET",path="/external/users",status="200",le="100"} 0 +web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="index",controller="TestApp.UserController",endpoint="WebAppWeb.Endpoint",method="GET",path="/external/users",status="200",le="1000"} 1 +web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="index",controller="TestApp.UserController",endpoint="WebAppWeb.Endpoint",method="GET",path="/external/users",status="200",le="10000"} 1 +web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="index",controller="TestApp.UserController",endpoint="WebAppWeb.Endpoint",method="GET",path="/external/users",status="200",le="30000"} 1 +web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="index",controller="TestApp.UserController",endpoint="WebAppWeb.Endpoint",method="GET",path="/external/users",status="200",le="500"} 1 +web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="index",controller="TestApp.UserController",endpoint="WebAppWeb.Endpoint",method="GET",path="/external/users",status="200",le="5000"} 1 +web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="index",controller="TestApp.UserController",endpoint="WebAppWeb.Endpoint",method="GET",path="/external/users",status="500",le="+Inf"} 1 +web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="index",controller="TestApp.UserController",endpoint="WebAppWeb.Endpoint",method="GET",path="/external/users",status="500",le="10"} 0 +web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="index",controller="TestApp.UserController",endpoint="WebAppWeb.Endpoint",method="GET",path="/external/users",status="500",le="100"} 1 +web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="index",controller="TestApp.UserController",endpoint="WebAppWeb.Endpoint",method="GET",path="/external/users",status="500",le="1000"} 1 +web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="index",controller="TestApp.UserController",endpoint="WebAppWeb.Endpoint",method="GET",path="/external/users",status="500",le="10000"} 1 +web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="index",controller="TestApp.UserController",endpoint="WebAppWeb.Endpoint",method="GET",path="/external/users",status="500",le="30000"} 1 +web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="index",controller="TestApp.UserController",endpoint="WebAppWeb.Endpoint",method="GET",path="/external/users",status="500",le="500"} 1 +web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="index",controller="TestApp.UserController",endpoint="WebAppWeb.Endpoint",method="GET",path="/external/users",status="500",le="5000"} 1 +web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="index",controller="TestApp.UserController",endpoint="WebAppWeb.Endpoint",method="GET",path="/internal/users",status="200",le="+Inf"} 2 +web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="index",controller="TestApp.UserController",endpoint="WebAppWeb.Endpoint",method="GET",path="/internal/users",status="200",le="10"} 0 +web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="index",controller="TestApp.UserController",endpoint="WebAppWeb.Endpoint",method="GET",path="/internal/users",status="200",le="100"} 0 +web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="index",controller="TestApp.UserController",endpoint="WebAppWeb.Endpoint",method="GET",path="/internal/users",status="200",le="1000"} 2 +web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="index",controller="TestApp.UserController",endpoint="WebAppWeb.Endpoint",method="GET",path="/internal/users",status="200",le="10000"} 2 +web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="index",controller="TestApp.UserController",endpoint="WebAppWeb.Endpoint",method="GET",path="/internal/users",status="200",le="30000"} 2 +web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="index",controller="TestApp.UserController",endpoint="WebAppWeb.Endpoint",method="GET",path="/internal/users",status="200",le="500"} 2 +web_app_prom_ex_phoenix_http_request_duration_milliseconds_bucket{action="index",controller="TestApp.UserController",endpoint="WebAppWeb.Endpoint",method="GET",path="/internal/users",status="200",le="5000"} 2 +web_app_prom_ex_phoenix_http_request_duration_milliseconds_count{action="NA",controller="NA",endpoint="Unknown",method="GET",path="another_label",status="200"} 1 +web_app_prom_ex_phoenix_http_request_duration_milliseconds_count{action="NA",controller="NA",endpoint="Unknown",method="GET",path="special_label",status="200"} 2 +web_app_prom_ex_phoenix_http_request_duration_milliseconds_count{action="index",controller="TestApp.UserController",endpoint="WebAppWeb.Endpoint",method="GET",path="/external/users",status="200"} 1 +web_app_prom_ex_phoenix_http_request_duration_milliseconds_count{action="index",controller="TestApp.UserController",endpoint="WebAppWeb.Endpoint",method="GET",path="/external/users",status="500"} 1 +web_app_prom_ex_phoenix_http_request_duration_milliseconds_count{action="index",controller="TestApp.UserController",endpoint="WebAppWeb.Endpoint",method="GET",path="/internal/users",status="200"} 2 +web_app_prom_ex_phoenix_http_request_duration_milliseconds_sum{action="NA",controller="NA",endpoint="Unknown",method="GET",path="another_label",status="200"} 0.046467 +web_app_prom_ex_phoenix_http_request_duration_milliseconds_sum{action="NA",controller="NA",endpoint="Unknown",method="GET",path="special_label",status="200"} 0.085461 +web_app_prom_ex_phoenix_http_request_duration_milliseconds_sum{action="index",controller="TestApp.UserController",endpoint="WebAppWeb.Endpoint",method="GET",path="/external/users",status="200"} 335.966925 +web_app_prom_ex_phoenix_http_request_duration_milliseconds_sum{action="index",controller="TestApp.UserController",endpoint="WebAppWeb.Endpoint",method="GET",path="/external/users",status="500"} 10.729941 +web_app_prom_ex_phoenix_http_request_duration_milliseconds_sum{action="index",controller="TestApp.UserController",endpoint="WebAppWeb.Endpoint",method="GET",path="/internal/users",status="200"} 619.828049 +web_app_prom_ex_phoenix_http_requests_total{action="NA",controller="NA",endpoint="Unknown",method="GET",path="another_label",status="200"} 1 +web_app_prom_ex_phoenix_http_requests_total{action="NA",controller="NA",endpoint="Unknown",method="GET",path="special_label",status="200"} 2 +web_app_prom_ex_phoenix_http_requests_total{action="index",controller="TestApp.UserController",endpoint="WebAppWeb.Endpoint",method="GET",path="/external/users",status="200"} 1 +web_app_prom_ex_phoenix_http_requests_total{action="index",controller="TestApp.UserController",endpoint="WebAppWeb.Endpoint",method="GET",path="/external/users",status="500"} 1 +web_app_prom_ex_phoenix_http_requests_total{action="index",controller="TestApp.UserController",endpoint="WebAppWeb.Endpoint",method="GET",path="/internal/users",status="200"} 2 +web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="NA",controller="NA",endpoint="Unknown",method="GET",path="another_label",status="200",le="+Inf"} 1 +web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="NA",controller="NA",endpoint="Unknown",method="GET",path="another_label",status="200",le="1048576"} 1 +web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="NA",controller="NA",endpoint="Unknown",method="GET",path="another_label",status="200",le="16777216"} 1 +web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="NA",controller="NA",endpoint="Unknown",method="GET",path="another_label",status="200",le="262144"} 1 +web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="NA",controller="NA",endpoint="Unknown",method="GET",path="another_label",status="200",le="4096"} 1 +web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="NA",controller="NA",endpoint="Unknown",method="GET",path="another_label",status="200",le="4194304"} 1 +web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="NA",controller="NA",endpoint="Unknown",method="GET",path="another_label",status="200",le="512"} 1 +web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="NA",controller="NA",endpoint="Unknown",method="GET",path="another_label",status="200",le="64"} 1 +web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="NA",controller="NA",endpoint="Unknown",method="GET",path="another_label",status="200",le="65536"} 1 +web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="NA",controller="NA",endpoint="Unknown",method="GET",path="special_label",status="200",le="+Inf"} 2 +web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="NA",controller="NA",endpoint="Unknown",method="GET",path="special_label",status="200",le="1048576"} 2 +web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="NA",controller="NA",endpoint="Unknown",method="GET",path="special_label",status="200",le="16777216"} 2 +web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="NA",controller="NA",endpoint="Unknown",method="GET",path="special_label",status="200",le="262144"} 2 +web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="NA",controller="NA",endpoint="Unknown",method="GET",path="special_label",status="200",le="4096"} 2 +web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="NA",controller="NA",endpoint="Unknown",method="GET",path="special_label",status="200",le="4194304"} 2 +web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="NA",controller="NA",endpoint="Unknown",method="GET",path="special_label",status="200",le="512"} 2 +web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="NA",controller="NA",endpoint="Unknown",method="GET",path="special_label",status="200",le="64"} 2 +web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="NA",controller="NA",endpoint="Unknown",method="GET",path="special_label",status="200",le="65536"} 2 +web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="index",controller="TestApp.UserController",endpoint="WebAppWeb.Endpoint",method="GET",path="/external/users",status="200",le="+Inf"} 1 +web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="index",controller="TestApp.UserController",endpoint="WebAppWeb.Endpoint",method="GET",path="/external/users",status="200",le="1048576"} 1 +web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="index",controller="TestApp.UserController",endpoint="WebAppWeb.Endpoint",method="GET",path="/external/users",status="200",le="16777216"} 1 +web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="index",controller="TestApp.UserController",endpoint="WebAppWeb.Endpoint",method="GET",path="/external/users",status="200",le="262144"} 1 +web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="index",controller="TestApp.UserController",endpoint="WebAppWeb.Endpoint",method="GET",path="/external/users",status="200",le="4096"} 1 +web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="index",controller="TestApp.UserController",endpoint="WebAppWeb.Endpoint",method="GET",path="/external/users",status="200",le="4194304"} 1 +web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="index",controller="TestApp.UserController",endpoint="WebAppWeb.Endpoint",method="GET",path="/external/users",status="200",le="512"} 0 +web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="index",controller="TestApp.UserController",endpoint="WebAppWeb.Endpoint",method="GET",path="/external/users",status="200",le="64"} 0 +web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="index",controller="TestApp.UserController",endpoint="WebAppWeb.Endpoint",method="GET",path="/external/users",status="200",le="65536"} 1 +web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="index",controller="TestApp.UserController",endpoint="WebAppWeb.Endpoint",method="GET",path="/external/users",status="500",le="+Inf"} 1 +web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="index",controller="TestApp.UserController",endpoint="WebAppWeb.Endpoint",method="GET",path="/external/users",status="500",le="1048576"} 1 +web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="index",controller="TestApp.UserController",endpoint="WebAppWeb.Endpoint",method="GET",path="/external/users",status="500",le="16777216"} 1 +web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="index",controller="TestApp.UserController",endpoint="WebAppWeb.Endpoint",method="GET",path="/external/users",status="500",le="262144"} 1 +web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="index",controller="TestApp.UserController",endpoint="WebAppWeb.Endpoint",method="GET",path="/external/users",status="500",le="4096"} 0 +web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="index",controller="TestApp.UserController",endpoint="WebAppWeb.Endpoint",method="GET",path="/external/users",status="500",le="4194304"} 1 +web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="index",controller="TestApp.UserController",endpoint="WebAppWeb.Endpoint",method="GET",path="/external/users",status="500",le="512"} 0 +web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="index",controller="TestApp.UserController",endpoint="WebAppWeb.Endpoint",method="GET",path="/external/users",status="500",le="64"} 0 +web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="index",controller="TestApp.UserController",endpoint="WebAppWeb.Endpoint",method="GET",path="/external/users",status="500",le="65536"} 0 +web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="index",controller="TestApp.UserController",endpoint="WebAppWeb.Endpoint",method="GET",path="/internal/users",status="200",le="+Inf"} 2 +web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="index",controller="TestApp.UserController",endpoint="WebAppWeb.Endpoint",method="GET",path="/internal/users",status="200",le="1048576"} 2 +web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="index",controller="TestApp.UserController",endpoint="WebAppWeb.Endpoint",method="GET",path="/internal/users",status="200",le="16777216"} 2 +web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="index",controller="TestApp.UserController",endpoint="WebAppWeb.Endpoint",method="GET",path="/internal/users",status="200",le="262144"} 2 +web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="index",controller="TestApp.UserController",endpoint="WebAppWeb.Endpoint",method="GET",path="/internal/users",status="200",le="4096"} 2 +web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="index",controller="TestApp.UserController",endpoint="WebAppWeb.Endpoint",method="GET",path="/internal/users",status="200",le="4194304"} 2 +web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="index",controller="TestApp.UserController",endpoint="WebAppWeb.Endpoint",method="GET",path="/internal/users",status="200",le="512"} 0 +web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="index",controller="TestApp.UserController",endpoint="WebAppWeb.Endpoint",method="GET",path="/internal/users",status="200",le="64"} 0 +web_app_prom_ex_phoenix_http_response_size_bytes_bucket{action="index",controller="TestApp.UserController",endpoint="WebAppWeb.Endpoint",method="GET",path="/internal/users",status="200",le="65536"} 2 +web_app_prom_ex_phoenix_http_response_size_bytes_count{action="NA",controller="NA",endpoint="Unknown",method="GET",path="another_label",status="200"} 1 +web_app_prom_ex_phoenix_http_response_size_bytes_count{action="NA",controller="NA",endpoint="Unknown",method="GET",path="special_label",status="200"} 2 +web_app_prom_ex_phoenix_http_response_size_bytes_count{action="index",controller="TestApp.UserController",endpoint="WebAppWeb.Endpoint",method="GET",path="/external/users",status="200"} 1 +web_app_prom_ex_phoenix_http_response_size_bytes_count{action="index",controller="TestApp.UserController",endpoint="WebAppWeb.Endpoint",method="GET",path="/external/users",status="500"} 1 +web_app_prom_ex_phoenix_http_response_size_bytes_count{action="index",controller="TestApp.UserController",endpoint="WebAppWeb.Endpoint",method="GET",path="/internal/users",status="200"} 2 +web_app_prom_ex_phoenix_http_response_size_bytes_sum{action="NA",controller="NA",endpoint="Unknown",method="GET",path="another_label",status="200"} 7 +web_app_prom_ex_phoenix_http_response_size_bytes_sum{action="NA",controller="NA",endpoint="Unknown",method="GET",path="special_label",status="200"} 16 +web_app_prom_ex_phoenix_http_response_size_bytes_sum{action="index",controller="TestApp.UserController",endpoint="WebAppWeb.Endpoint",method="GET",path="/external/users",status="200"} 3332 +web_app_prom_ex_phoenix_http_response_size_bytes_sum{action="index",controller="TestApp.UserController",endpoint="WebAppWeb.Endpoint",method="GET",path="/external/users",status="500"} 70822 +web_app_prom_ex_phoenix_http_response_size_bytes_sum{action="index",controller="TestApp.UserController",endpoint="WebAppWeb.Endpoint",method="GET",path="/internal/users",status="200"} 6664 +web_app_prom_ex_prom_ex_status_info 1 From f703bc439d617df94730131789be0bc44f3f795f Mon Sep 17 00:00:00 2001 From: Nick Dichev Date: Mon, 30 May 2022 17:35:08 -0700 Subject: [PATCH 2/5] Initial changes to Phoenix dashboard JSON to include endpoint --- priv/phoenix.json.eex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/priv/phoenix.json.eex b/priv/phoenix.json.eex index ce80d877..e8f5ca77 100644 --- a/priv/phoenix.json.eex +++ b/priv/phoenix.json.eex @@ -813,7 +813,7 @@ "reverseYBuckets": false, "targets": [ { - "expr": "sum(irate(<%= @phoenix_metric_prefix %>_http_request_duration_milliseconds_bucket{job=\"$job\", instance=\"$instance\"}[$interval])) by (le)", + "expr": "sum(irate(<%= @phoenix_metric_prefix %>_http_request_duration_milliseconds_bucket{job=\"$job\", instance=\"$instance\", endpoint=\"$endpoint\"}[$interval])) by (le)", "format": "heatmap", "hide": false, "interval": "", @@ -969,7 +969,7 @@ "steppedLine": false, "targets": [ { - "expr": "sum(irate(<%= @phoenix_metric_prefix %>_http_request_duration_milliseconds_sum{job=\"$job\", instance=\"$instance\"}[$interval])) by(path, status) / sum(irate(<%= @phoenix_metric_prefix %>_http_request_duration_milliseconds_count{job=\"$job\", instance=\"$instance\"}[$interval])) by(path, status)", + "expr": "sum(irate(<%= @phoenix_metric_prefix %>_http_request_duration_milliseconds_sum{job=\"$job\", instance=\"$instance\", endpoint=\"$endpoint\"}[$interval])) by(path, status) / sum(irate(<%= @phoenix_metric_prefix %>_http_request_duration_milliseconds_count{job=\"$job\", instance=\"$instance\", endpoint=\"$endpoint\"}[$interval])) by(path, status)", "interval": "", "legendFormat": "{{ method }} {{ path }} :: {{ status }}", "refId": "A" From 28e4b8a37abf64add513e5e456da0ea356f93f1b Mon Sep 17 00:00:00 2001 From: Nick Dichev Date: Sat, 4 Jun 2022 08:28:33 -0700 Subject: [PATCH 3/5] Rename default_route_tags/0 -> default_conn_tags/0 --- lib/prom_ex/plugins/phoenix.ex | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/prom_ex/plugins/phoenix.ex b/lib/prom_ex/plugins/phoenix.ex index 5dff21d2..80f885e3 100644 --- a/lib/prom_ex/plugins/phoenix.ex +++ b/lib/prom_ex/plugins/phoenix.ex @@ -365,7 +365,7 @@ if Code.ensure_loaded?(Phoenix) do defp get_conn_tags(routers, []) do fn %{conn: %Conn{} = conn} -> - merge_conn_tags(conn, routers, default_route_tags()) + merge_conn_tags(conn, routers, default_conn_tags()) _ -> Logger.warning("Could not resolve tags for request") @@ -375,19 +375,19 @@ if Code.ensure_loaded?(Phoenix) do defp get_conn_tags(routers, additional_routes) do fn %{conn: %Conn{} = conn} -> - default_route_tags = handle_additional_routes_check(conn, additional_routes) - merge_conn_tags(conn, routers, default_route_tags) + default_conn_tags = handle_additional_routes_check(conn, additional_routes) + merge_conn_tags(conn, routers, default_conn_tags) _ -> Logger.warning("Could not resolve tags for request") end end - defp merge_conn_tags(conn, routers, default_route_tags) do + defp merge_conn_tags(conn, routers, default_conn_tags) do endpoint_tags = do_get_endpoint_tags(conn) - router_tags = do_get_router_tags(conn, routers, default_route_tags) + router_tags = do_get_router_tags(conn, routers, default_conn_tags) - default_route_tags + default_conn_tags |> Map.merge(endpoint_tags) |> Map.merge(router_tags) |> Map.merge(%{status: conn.status, method: conn.method}) @@ -406,9 +406,9 @@ if Code.ensure_loaded?(Phoenix) do end end - defp do_get_router_tags(conn, routers, default_route_tags) do + defp do_get_router_tags(conn, routers, default_conn_tags) do routers - |> Enum.find_value(default_route_tags, fn router -> + |> Enum.find_value(default_conn_tags, fn router -> case Phoenix.Router.route_info(router, conn.method, conn.request_path, "") do :error -> false @@ -425,13 +425,13 @@ if Code.ensure_loaded?(Phoenix) do defp handle_additional_routes_check(%Conn{request_path: request_path}, additional_routes) do additional_routes - |> Enum.find_value(default_route_tags(), fn {path_label, route_check} -> + |> Enum.find_value(default_conn_tags(), fn {path_label, route_check} -> cond do is_binary(route_check) and route_check == request_path -> - default_route_tags(path: path_label, controller: "NA", action: "NA") + default_conn_tags(path: path_label, controller: "NA", action: "NA") match?(%Regex{}, route_check) and Regex.match?(route_check, request_path) -> - default_route_tags(path: path_label, controller: "NA", action: "NA") + default_conn_tags(path: path_label, controller: "NA", action: "NA") true -> false @@ -439,7 +439,7 @@ if Code.ensure_loaded?(Phoenix) do end) end - defp default_route_tags(opts \\ []) do + defp default_conn_tags(opts \\ []) do %{ path: Keyword.get(opts, :path, @unknown_value), controller: Keyword.get(opts, :controller, @unknown_value), From 88bc3a7da10b371e4d584ecc9e9dda6c5a790951 Mon Sep 17 00:00:00 2001 From: Nick Dichev Date: Sat, 4 Jun 2022 09:06:41 -0700 Subject: [PATCH 4/5] Update broadway to 1.0.3 in example web app --- example_applications/web_app/mix.lock | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/example_applications/web_app/mix.lock b/example_applications/web_app/mix.lock index 31fdde17..4d7061d9 100644 --- a/example_applications/web_app/mix.lock +++ b/example_applications/web_app/mix.lock @@ -1,6 +1,6 @@ %{ - "broadway": {:hex, :broadway, "1.0.1", "7b4ca0b439a425730b5fc1bf06aae350df6171434fd4f29bdbbe50d2d9d518fb", [:mix], [{:gen_stage, "~> 1.0", [hex: :gen_stage, repo: "hexpm", optional: false]}, {:nimble_options, "~> 0.3.7", [hex: :nimble_options, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.3 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "6d1c7fdc100ba484a477c42881553dfa1730f31c461308286132efbfeb85568f"}, - "castore": {:hex, :castore, "0.1.14", "3f6d7c7c1574c402fef29559d3f1a7389ba3524bc6a090a5e9e6abc3af65dcca", [:mix], [], "hexpm", "b34af542eadb727e6c8b37fdf73e18b2e02eb483a4ea0b52fd500bc23f052b7b"}, + "broadway": {:hex, :broadway, "1.0.3", "04014322955d46c97d0608dbac2a76522d8a558245422fb6b3a6157ff7a0e36c", [:mix], [{:gen_stage, "~> 1.0", [hex: :gen_stage, repo: "hexpm", optional: false]}, {:nimble_options, "~> 0.3.7 or ~> 0.4.0", [hex: :nimble_options, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.3 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "02562445a5af75288648a1cf7fe4ac8cb42acb3626a2339332f57951589fdd7b"}, + "castore": {:hex, :castore, "0.1.17", "ba672681de4e51ed8ec1f74ed624d104c0db72742ea1a5e74edbc770c815182f", [:mix], [], "hexpm", "d9844227ed52d26e7519224525cb6868650c272d4a3d327ce3ca5570c12163f9"}, "connection": {:hex, :connection, "1.1.0", "ff2a49c4b75b6fb3e674bfc5536451607270aac754ffd1bdfe175abe4a6d7a68", [:mix], [], "hexpm", "722c1eb0a418fbe91ba7bd59a47e28008a189d47e37e0e7bb85585a016b2869c"}, "cowboy": {:hex, :cowboy, "2.9.0", "865dd8b6607e14cf03282e10e934023a1bd8be6f6bacf921a7e2a96d800cd452", [:make, :rebar3], [{:cowlib, "2.11.0", [hex: :cowlib, repo: "hexpm", optional: false]}, {:ranch, "1.8.0", [hex: :ranch, repo: "hexpm", optional: false]}], "hexpm", "2c729f934b4e1aa149aff882f57c6372c15399a20d54f65c8d67bef583021bde"}, "cowboy_telemetry": {:hex, :cowboy_telemetry, "0.4.0", "f239f68b588efa7707abce16a84d0d2acf3a0f50571f8bb7f56a15865aae820c", [:rebar3], [{:cowboy, "~> 2.7", [hex: :cowboy, repo: "hexpm", optional: false]}, {:telemetry, "~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "7d98bac1ee4565d31b62d59f8823dfd8356a169e7fcbb83831b8a5397404c9de"}, @@ -13,16 +13,17 @@ "erlex": {:hex, :erlex, "0.2.6", "c7987d15e899c7a2f34f5420d2a2ea0d659682c06ac607572df55a43753aa12e", [:mix], [], "hexpm", "2ed2e25711feb44d52b17d2780eabf998452f6efda104877a3881c2f8c0c0c75"}, "faker": {:hex, :faker, "0.17.0", "671019d0652f63aefd8723b72167ecdb284baf7d47ad3a82a15e9b8a6df5d1fa", [:mix], [], "hexpm", "a7d4ad84a93fd25c5f5303510753789fc2433ff241bf3b4144d3f6f291658a6a"}, "file_system": {:hex, :file_system, "0.2.10", "fb082005a9cd1711c05b5248710f8826b02d7d1784e7c3451f9c1231d4fc162d", [:mix], [], "hexpm", "41195edbfb562a593726eda3b3e8b103a309b733ad25f3d642ba49696bf715dc"}, - "finch": {:hex, :finch, "0.9.0", "8b772324aebafcaba763f1dffaa3e7f52f8c4e52485f50f48bbb2f42219a2e87", [:mix], [{:castore, "~> 0.1", [hex: :castore, repo: "hexpm", optional: false]}, {:mint, "~> 1.3", [hex: :mint, repo: "hexpm", optional: false]}, {:nimble_options, "~> 0.3.5", [hex: :nimble_options, repo: "hexpm", optional: false]}, {:nimble_pool, "~> 0.2", [hex: :nimble_pool, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "a93bfcad9ca50fa3cb2d459f27667d9a87cfbb7fecf9b29b2e78a50bc2ab445d"}, + "finch": {:hex, :finch, "0.10.2", "9ad27d68270d879f73f26604bb2e573d40f29bf0e907064a9a337f90a16a0312", [:mix], [{:castore, "~> 0.1", [hex: :castore, repo: "hexpm", optional: false]}, {:mint, "~> 1.3", [hex: :mint, repo: "hexpm", optional: false]}, {:nimble_options, "~> 0.4.0", [hex: :nimble_options, repo: "hexpm", optional: false]}, {:nimble_pool, "~> 0.2", [hex: :nimble_pool, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "dd8b11b282072cec2ef30852283949c248bd5d2820c88d8acc89402b81db7550"}, "floki": {:hex, :floki, "0.32.0", "f915dc15258bc997d49be1f5ef7d3992f8834d6f5695270acad17b41f5bcc8e2", [:mix], [{:html_entities, "~> 0.5.0", [hex: :html_entities, repo: "hexpm", optional: false]}], "hexpm", "1c5a91cae1fd8931c26a4826b5e2372c284813904c8bacb468b5de39c7ececbd"}, "gen_stage": {:hex, :gen_stage, "1.1.2", "b1656cd4ba431ed02c5656fe10cb5423820847113a07218da68eae5d6a260c23", [:mix], [], "hexpm", "9e39af23140f704e2b07a3e29d8f05fd21c2aaf4088ff43cb82be4b9e3148d02"}, "gettext": {:hex, :gettext, "0.19.0", "6909d61b38bb33339558f128f8af5913d5d5fe304a770217bf352b1620fb7ec4", [:mix], [], "hexpm", "3f7a274f52ebda9bb6655dfeda3d6b0dc4537ae51ce41dcccc7f73ca7379ad5e"}, + "hpax": {:hex, :hpax, "0.1.1", "2396c313683ada39e98c20a75a82911592b47e5c24391363343bde74f82396ca", [:mix], [], "hexpm", "0ae7d5a0b04a8a60caf7a39fcf3ec476f35cc2cc16c05abea730d3ce6ac6c826"}, "html_entities": {:hex, :html_entities, "0.5.2", "9e47e70598da7de2a9ff6af8758399251db6dbb7eebe2b013f2bbd2515895c3c", [:mix], [], "hexpm", "c53ba390403485615623b9531e97696f076ed415e8d8058b1dbaa28181f4fdcc"}, "jason": {:hex, :jason, "1.3.0", "fa6b82a934feb176263ad2df0dbd91bf633d4a46ebfdffea0c8ae82953714946", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "53fc1f51255390e0ec7e50f9cb41e751c260d065dcba2bf0d08dc51a4002c2ac"}, "mime": {:hex, :mime, "2.0.2", "0b9e1a4c840eafb68d820b0e2158ef5c49385d17fb36855ac6e7e087d4b1dcc5", [:mix], [], "hexpm", "e6a3f76b4c277739e36c2e21a2c640778ba4c3846189d5ab19f97f126df5f9b7"}, - "mint": {:hex, :mint, "1.4.0", "cd7d2451b201fc8e4a8fd86257fb3878d9e3752899eb67b0c5b25b180bde1212", [:mix], [{:castore, "~> 0.1.0", [hex: :castore, repo: "hexpm", optional: true]}], "hexpm", "10a99e144b815cbf8522dccbc8199d15802440fc7a64d67b6853adb6fa170217"}, - "nimble_options": {:hex, :nimble_options, "0.3.7", "1e52dd7673d36138b1a5dede183b5d86dff175dc46d104a8e98e396b85b04670", [:mix], [], "hexpm", "2086907e6665c6b6579be54ef5001928df5231f355f71ed258f80a55e9f63633"}, - "nimble_pool": {:hex, :nimble_pool, "0.2.4", "1db8e9f8a53d967d595e0b32a17030cdb6c0dc4a451b8ac787bf601d3f7704c3", [:mix], [], "hexpm", "367e8071e137b787764e6a9992ccb57b276dc2282535f767a07d881951ebeac6"}, + "mint": {:hex, :mint, "1.4.1", "49b3b6ea35a9a38836d2ad745251b01ca9ec062f7cb66f546bf22e6699137126", [:mix], [{:castore, "~> 0.1.0", [hex: :castore, repo: "hexpm", optional: true]}, {:hpax, "~> 0.1.1", [hex: :hpax, repo: "hexpm", optional: false]}], "hexpm", "cd261766e61011a9079cccf8fa9d826e7a397c24fbedf0e11b49312bea629b58"}, + "nimble_options": {:hex, :nimble_options, "0.4.0", "c89babbab52221a24b8d1ff9e7d838be70f0d871be823165c94dd3418eea728f", [:mix], [], "hexpm", "e6701c1af326a11eea9634a3b1c62b475339ace9456c1a23ec3bc9a847bca02d"}, + "nimble_pool": {:hex, :nimble_pool, "0.2.6", "91f2f4c357da4c4a0a548286c84a3a28004f68f05609b4534526871a22053cde", [:mix], [], "hexpm", "1c715055095d3f2705c4e236c18b618420a35490da94149ff8b580a2144f653f"}, "oban": {:hex, :oban, "2.9.2", "5504c1c28d0b04e326c1075bd5f0f9c0fbe93850f581d9b201e2e2ad86ef8cc8", [:mix], [{:ecto_sql, ">= 3.4.3", [hex: :ecto_sql, repo: "hexpm", optional: false]}, {:jason, "~> 1.1", [hex: :jason, repo: "hexpm", optional: false]}, {:postgrex, "~> 0.14", [hex: :postgrex, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "f05a042c6611c013a21717dd78cc1e64690b6b66885e6e237c3a2af1b9e9cff8"}, "phoenix": {:hex, :phoenix, "1.6.5", "07af307b28a5820b4394f27ac7003df052e065ff651520a58abb16be1eecd519", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix_pubsub, "~> 2.0", [hex: :phoenix_pubsub, repo: "hexpm", optional: false]}, {:phoenix_view, "~> 1.0", [hex: :phoenix_view, repo: "hexpm", optional: false]}, {:plug, "~> 1.10", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 2.2", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:plug_crypto, "~> 1.2", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "97dc3052ca648499280e0636471f1d0439fc623ccdce27d2d8135651421ee80c"}, "phoenix_ecto": {:hex, :phoenix_ecto, "4.4.0", "0672ed4e4808b3fbed494dded89958e22fb882de47a97634c0b13e7b0b5f7720", [:mix], [{:ecto, "~> 3.3", [hex: :ecto, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 2.14.2 or ~> 3.0", [hex: :phoenix_html, repo: "hexpm", optional: true]}, {:plug, "~> 1.9", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "09864e558ed31ee00bd48fcc1d4fc58ae9678c9e81649075431e69dbabb43cc1"}, From 29caa75280c4874fcdf6631c833449e3a2850029 Mon Sep 17 00:00:00 2001 From: Nick Dichev Date: Sat, 4 Jun 2022 09:38:52 -0700 Subject: [PATCH 5/5] Add endpoint to remaining Phoenix dashboard panel queries --- priv/phoenix.json.eex | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/priv/phoenix.json.eex b/priv/phoenix.json.eex index e8f5ca77..69d49527 100644 --- a/priv/phoenix.json.eex +++ b/priv/phoenix.json.eex @@ -327,7 +327,7 @@ "pluginVersion": "7.1.3", "targets": [ { - "expr": "(\n (\n sum(increase(<%= @phoenix_metric_prefix %>_http_request_duration_milliseconds_bucket{job=\"$job\", instance=\"$instance\", le=\"500\", status=~\"2..\"}[24h])) + \n (sum(increase(<%= @phoenix_metric_prefix %>_http_request_duration_milliseconds_bucket{job=\"$job\", instance=\"$instance\", le=\"1000\", status=~\"2..\"}[24h])) - sum(increase(<%= @phoenix_metric_prefix %>_http_request_duration_milliseconds_bucket{job=\"$job\", instance=\"$instance\", le=\"500\", status=~\"2..\"}[24h]))) / 2\n ) \n / \n sum(increase(<%= @phoenix_metric_prefix %>_http_request_duration_milliseconds_count{job=\"$job\", instance=\"$instance\", status=~\"2..\"}[24h]))\n) * 100", + "expr": "(\n (\n sum(increase(<%= @phoenix_metric_prefix %>_http_request_duration_milliseconds_bucket{job=\"$job\", instance=\"$instance\", endpoint=\"$endpoint\", le=\"500\", status=~\"2..\"}[24h])) + \n (sum(increase(<%= @phoenix_metric_prefix %>_http_request_duration_milliseconds_bucket{job=\"$job\", instance=\"$instance\", endpoint=\"$endpoint\", le=\"1000\", status=~\"2..\"}[24h])) - sum(increase(<%= @phoenix_metric_prefix %>_http_request_duration_milliseconds_bucket{job=\"$job\", instance=\"$instance\", endpoint=\"$endpoint\", le=\"500\", status=~\"2..\"}[24h]))) / 2\n ) \n / \n sum(increase(<%= @phoenix_metric_prefix %>_http_request_duration_milliseconds_count{job=\"$job\", instance=\"$instance\", endpoint=\"$endpoint\", status=~\"2..\"}[24h]))\n) * 100", "instant": false, "interval": "", "legendFormat": "", @@ -391,7 +391,7 @@ "pluginVersion": "7.1.3", "targets": [ { - "expr": "sum(increase(<%= @phoenix_metric_prefix %>_http_requests_total{job=\"$job\", instance=\"$instance\", status=~\"4..|5..\"}[24h])) / sum(increase(<%= @phoenix_metric_prefix %>_http_requests_total{job=\"$job\", instance=\"$instance\"}[24h])) OR on() vector(0)", + "expr": "sum(increase(<%= @phoenix_metric_prefix %>_http_requests_total{job=\"$job\", instance=\"$instance\", endpoint=\"$endpoint\", status=~\"4..|5..\"}[24h])) / sum(increase(<%= @phoenix_metric_prefix %>_http_requests_total{job=\"$job\", instance=\"$instance\", endpoint=\"$endpoint\"}[24h])) OR on() vector(0)", "instant": false, "interval": "", "legendFormat": "", @@ -447,7 +447,7 @@ "pluginVersion": "7.1.3", "targets": [ { - "expr": "sum(increase(<%= @phoenix_metric_prefix %>_http_response_size_bytes_sum{job=\"$job\", instance=\"$instance\"}[24h]))", + "expr": "sum(increase(<%= @phoenix_metric_prefix %>_http_response_size_bytes_sum{job=\"$job\", instance=\"$instance\", endpoint=\"$endpoint\"}[24h]))", "instant": false, "interval": "", "legendFormat": "", @@ -503,7 +503,7 @@ "pluginVersion": "7.1.3", "targets": [ { - "expr": "round(sum(increase(<%= @phoenix_metric_prefix %>_http_requests_total{job=\"$job\", instance=\"$instance\"}[24h])))", + "expr": "round(sum(increase(<%= @phoenix_metric_prefix %>_http_requests_total{job=\"$job\", instance=\"$instance\", endpoint=\"$endpoint\"}[24h])))", "instant": false, "interval": "", "legendFormat": "", @@ -572,7 +572,7 @@ "pluginVersion": "7.1.3", "targets": [ { - "expr": "(\n (\n sum(increase(<%= @phoenix_metric_prefix %>_http_request_duration_milliseconds_bucket{job=\"$job\", instance=\"$instance\", le=\"500\", status=~\"2..\"}[1h])) + \n (sum(increase(<%= @phoenix_metric_prefix %>_http_request_duration_milliseconds_bucket{job=\"$job\", instance=\"$instance\", le=\"1000\", status=~\"2..\"}[1h])) - sum(increase(<%= @phoenix_metric_prefix %>_http_request_duration_milliseconds_bucket{job=\"$job\", instance=\"$instance\", le=\"500\", status=~\"2..\"}[1h]))) / 2\n ) \n / \n sum(increase(<%= @phoenix_metric_prefix %>_http_request_duration_milliseconds_count{job=\"$job\", instance=\"$instance\", status=~\"2..\"}[1h]))\n) * 100", + "expr": "(\n (\n sum(increase(<%= @phoenix_metric_prefix %>_http_request_duration_milliseconds_bucket{job=\"$job\", instance=\"$instance\", endpoint=\"$endpoint\", le=\"500\", status=~\"2..\"}[1h])) + \n (sum(increase(<%= @phoenix_metric_prefix %>_http_request_duration_milliseconds_bucket{job=\"$job\", instance=\"$instance\", endpoint=\"$endpoint\", le=\"1000\", status=~\"2..\"}[1h])) - sum(increase(<%= @phoenix_metric_prefix %>_http_request_duration_milliseconds_bucket{job=\"$job\", instance=\"$instance\", endpoint=\"$endpoint\", le=\"500\", status=~\"2..\"}[1h]))) / 2\n ) \n / \n sum(increase(<%= @phoenix_metric_prefix %>_http_request_duration_milliseconds_count{job=\"$job\", instance=\"$instance\", endpoint=\"$endpoint\", status=~\"2..\"}[1h]))\n) * 100", "instant": false, "interval": "", "legendFormat": "", @@ -637,7 +637,7 @@ "pluginVersion": "7.1.3", "targets": [ { - "expr": "sum(increase(<%= @phoenix_metric_prefix %>_http_requests_total{job=\"$job\", instance=\"$instance\", status=~\"4..|5..\"}[1h])) / sum(increase(<%= @phoenix_metric_prefix %>_http_requests_total{job=\"$job\", instance=\"$instance\"}[1h])) OR on() vector(0)", + "expr": "sum(increase(<%= @phoenix_metric_prefix %>_http_requests_total{job=\"$job\", instance=\"$instance\", endpoint=\"$endpoint\", status=~\"4..|5..\"}[1h])) / sum(increase(<%= @phoenix_metric_prefix %>_http_requests_total{job=\"$job\", instance=\"$instance\", endpoint=\"$endpoint\",}[1h])) OR on() vector(0)", "instant": false, "interval": "", "legendFormat": "", @@ -693,7 +693,7 @@ "pluginVersion": "7.1.3", "targets": [ { - "expr": "sum(increase(<%= @phoenix_metric_prefix %>_http_response_size_bytes_sum{job=\"$job\", instance=\"$instance\"}[1h]))", + "expr": "sum(increase(<%= @phoenix_metric_prefix %>_http_response_size_bytes_sum{job=\"$job\", instance=\"$instance\", endpoint=\"$endpoint\"}[1h]))", "instant": false, "interval": "", "legendFormat": "", @@ -749,7 +749,7 @@ "pluginVersion": "7.1.3", "targets": [ { - "expr": "round(sum(increase(<%= @phoenix_metric_prefix %>_http_requests_total{job=\"$job\", instance=\"$instance\"}[1h])))", + "expr": "round(sum(increase(<%= @phoenix_metric_prefix %>_http_requests_total{job=\"$job\", instance=\"$instance\", endpoint=\"$endpoint\"}[1h])))", "instant": false, "interval": "", "legendFormat": "", @@ -885,7 +885,7 @@ "reverseYBuckets": false, "targets": [ { - "expr": "sum(irate(<%= @phoenix_metric_prefix %>_http_response_size_bytes_bucket{job=\"$job\", instance=\"$instance\"}[$interval])) by (le)", + "expr": "sum(irate(<%= @phoenix_metric_prefix %>_http_response_size_bytes_bucket{job=\"$job\", instance=\"$instance\", endpoint=\"$endpoint\"}[$interval])) by (le)", "format": "heatmap", "hide": false, "interval": "", @@ -1066,7 +1066,7 @@ "steppedLine": false, "targets": [ { - "expr": "sum(irate(<%= @phoenix_metric_prefix %>_http_response_size_bytes_sum{job=\"$job\", instance=\"$instance\"}[$interval])) by(path, status) / sum(irate(<%= @phoenix_metric_prefix %>_http_response_size_bytes_count{job=\"$job\", instance=\"$instance\"}[$interval])) by(path, status)", + "expr": "sum(irate(<%= @phoenix_metric_prefix %>_http_response_size_bytes_sum{job=\"$job\", instance=\"$instance\", endpoint=\"$endpoint\"}[$interval])) by(path, status) / sum(irate(<%= @phoenix_metric_prefix %>_http_response_size_bytes_count{job=\"$job\", instance=\"$instance\", endpoint=\"$endpoint\"}[$interval])) by(path, status)", "interval": "", "legendFormat": "{{ method }} {{ path }} :: {{ status }}", "refId": "A" @@ -1163,7 +1163,7 @@ "steppedLine": false, "targets": [ { - "expr": "irate(<%= @phoenix_metric_prefix %>_http_requests_total{job=\"$job\", instance=\"$instance\"}[$interval])", + "expr": "irate(<%= @phoenix_metric_prefix %>_http_requests_total{job=\"$job\", instance=\"$instance\", endpoint=\"$endpoint\"}[$interval])", "interval": "", "legendFormat": "{{ method }} {{ path }} :: {{ status }}", "refId": "A" @@ -1258,19 +1258,19 @@ "steppedLine": false, "targets": [ { - "expr": "sum(irate(<%= @phoenix_metric_prefix %>_http_requests_total{status=~\"2..\", job=\"$job\", instance=\"$instance\"}[$interval]))", + "expr": "sum(irate(<%= @phoenix_metric_prefix %>_http_requests_total{status=~\"2..\", job=\"$job\", instance=\"$instance\", endpoint=\"$endpoint\"}[$interval]))", "interval": "", "legendFormat": "2xx", "refId": "A" }, { - "expr": "sum(irate(<%= @phoenix_metric_prefix %>_http_requests_total{status=~\"4..\", job=\"$job\", instance=\"$instance\"}[$interval]))", + "expr": "sum(irate(<%= @phoenix_metric_prefix %>_http_requests_total{status=~\"4..\", job=\"$job\", instance=\"$instance\", endpoint=\"$endpoint\"}[$interval]))", "interval": "", "legendFormat": "4xx", "refId": "B" }, { - "expr": "sum(irate(<%= @phoenix_metric_prefix %>_http_requests_total{status=~\"5..\", job=\"$job\", instance=\"$instance\"}[$interval]))", + "expr": "sum(irate(<%= @phoenix_metric_prefix %>_http_requests_total{status=~\"5..\", job=\"$job\", instance=\"$instance\", endpoint=\"$endpoint\"}[$interval]))", "interval": "", "legendFormat": "5xx", "refId": "C"