Reorganize metrics
Disable all Phoenix metrics - while useful in theory, I never got any specific insight from any of them.
This commit is contained in:
@@ -23,76 +23,27 @@ defmodule MusicLibraryWeb.Telemetry do
|
|||||||
|
|
||||||
def metrics do
|
def metrics do
|
||||||
[
|
[
|
||||||
# Phoenix Metrics
|
|
||||||
summary("phoenix.endpoint.stop.duration",
|
|
||||||
unit: {:native, :millisecond}
|
|
||||||
),
|
|
||||||
summary("phoenix.router_dispatch.stop.duration",
|
|
||||||
tags: [:route],
|
|
||||||
unit: {:native, :millisecond}
|
|
||||||
),
|
|
||||||
summary("phoenix.socket_connected.duration",
|
|
||||||
unit: {:native, :millisecond}
|
|
||||||
),
|
|
||||||
summary("phoenix.channel_joined.duration",
|
|
||||||
unit: {:native, :millisecond}
|
|
||||||
),
|
|
||||||
summary("phoenix.channel_handled_in.duration",
|
|
||||||
tags: [:event],
|
|
||||||
unit: {:native, :millisecond}
|
|
||||||
),
|
|
||||||
|
|
||||||
# LiveView Metrics
|
|
||||||
summary("phoenix.live_view.mount.stop.duration",
|
|
||||||
unit: {:native, :millisecond},
|
|
||||||
tags: [:view]
|
|
||||||
),
|
|
||||||
summary("phoenix.live_view.handle_params.stop.duration",
|
|
||||||
unit: {:native, :millisecond},
|
|
||||||
tags: [:view]
|
|
||||||
),
|
|
||||||
summary("phoenix.live_view.handle_event.stop.duration",
|
|
||||||
unit: {:native, :millisecond},
|
|
||||||
tags: [:view, :event]
|
|
||||||
),
|
|
||||||
summary("phoenix.live_view.render.stop.duration",
|
|
||||||
unit: {:native, :millisecond},
|
|
||||||
tags: [:view]
|
|
||||||
),
|
|
||||||
|
|
||||||
# LiveComponent Metrics
|
|
||||||
summary("phoenix.live_component.update.stop.duration",
|
|
||||||
unit: {:native, :millisecond},
|
|
||||||
tags: [:component],
|
|
||||||
drop: &drop_live_dashboard_events/1
|
|
||||||
),
|
|
||||||
summary("phoenix.live_component.handle_event.stop.duration",
|
|
||||||
unit: {:native, :millisecond},
|
|
||||||
tags: [:component, :event],
|
|
||||||
drop: &drop_live_dashboard_events/1
|
|
||||||
),
|
|
||||||
|
|
||||||
# Database Metrics
|
# Database Metrics
|
||||||
summary("music_library.repo.query.total_time",
|
summary("music_library.repo.query.total_time",
|
||||||
unit: {:native, :millisecond},
|
unit: {:native, :millisecond},
|
||||||
description: "The sum of the other measurements"
|
description: "The sum of the other measurements",
|
||||||
),
|
reporter_options: [
|
||||||
summary("music_library.repo.query.decode_time",
|
nav: "Repo"
|
||||||
unit: {:native, :millisecond},
|
]
|
||||||
description: "The time spent decoding the data received from the database"
|
|
||||||
),
|
),
|
||||||
summary("music_library.repo.query.query_time",
|
summary("music_library.repo.query.query_time",
|
||||||
unit: {:native, :millisecond},
|
unit: {:native, :millisecond},
|
||||||
description: "The time spent executing the query"
|
description: "The time spent executing the query",
|
||||||
|
reporter_options: [
|
||||||
|
nav: "Repo"
|
||||||
|
]
|
||||||
),
|
),
|
||||||
summary("music_library.repo.query.queue_time",
|
summary("music_library.repo.query.queue_time",
|
||||||
unit: {:native, :millisecond},
|
unit: {:native, :millisecond},
|
||||||
description: "The time spent waiting for a database connection"
|
description: "The time spent waiting for a database connection",
|
||||||
),
|
reporter_options: [
|
||||||
summary("music_library.repo.query.idle_time",
|
nav: "Repo"
|
||||||
unit: {:native, :millisecond},
|
]
|
||||||
description:
|
|
||||||
"The time the connection spent waiting before being checked out for the query"
|
|
||||||
),
|
),
|
||||||
|
|
||||||
# HTTP Metrics
|
# HTTP Metrics
|
||||||
@@ -102,7 +53,7 @@ defmodule MusicLibraryWeb.Telemetry do
|
|||||||
tag_values: &add_tags/1,
|
tag_values: &add_tags/1,
|
||||||
drop: &drop_archive_requests/1,
|
drop: &drop_archive_requests/1,
|
||||||
reporter_options: [
|
reporter_options: [
|
||||||
nav: "HTTP"
|
nav: "External APIs"
|
||||||
]
|
]
|
||||||
),
|
),
|
||||||
summary("finch.request.stop.duration",
|
summary("finch.request.stop.duration",
|
||||||
@@ -111,13 +62,19 @@ defmodule MusicLibraryWeb.Telemetry do
|
|||||||
tag_values: &add_tags/1,
|
tag_values: &add_tags/1,
|
||||||
drop: &drop_archive_requests/1,
|
drop: &drop_archive_requests/1,
|
||||||
reporter_options: [
|
reporter_options: [
|
||||||
nav: "HTTP"
|
nav: "External APIs"
|
||||||
]
|
]
|
||||||
),
|
),
|
||||||
|
|
||||||
# Assets
|
# Assets
|
||||||
summary("music_library.assets.cache_size", unit: {:byte, :kilobyte}),
|
summary("music_library.assets.cache_size",
|
||||||
summary("music_library.assets.content_size", unit: {:byte, :megabyte}),
|
unit: {:byte, :kilobyte},
|
||||||
|
reporter_options: [nav: "Assets"]
|
||||||
|
),
|
||||||
|
summary("music_library.assets.content_size",
|
||||||
|
unit: {:byte, :megabyte},
|
||||||
|
reporter_options: [nav: "Assets"]
|
||||||
|
),
|
||||||
|
|
||||||
# VM Metrics
|
# VM Metrics
|
||||||
summary("vm.memory.total", unit: {:byte, :megabyte}),
|
summary("vm.memory.total", unit: {:byte, :megabyte}),
|
||||||
@@ -149,11 +106,4 @@ defmodule MusicLibraryWeb.Telemetry do
|
|||||||
defp drop_archive_requests(metadata) do
|
defp drop_archive_requests(metadata) do
|
||||||
metadata.request.host =~ "archive.org"
|
metadata.request.host =~ "archive.org"
|
||||||
end
|
end
|
||||||
|
|
||||||
defp drop_live_dashboard_events(metadata) do
|
|
||||||
case Module.split(metadata.component) do
|
|
||||||
["Phoenix" | _rest] -> true
|
|
||||||
_ -> false
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user