Add database metrics to Prometheus endpoint
This commit is contained in:
@@ -110,7 +110,30 @@ defmodule MusicLibraryWeb.Telemetry do
|
||||
last_value("vm.memory.total", unit: {:byte, :megabyte}),
|
||||
last_value("vm.total_run_queue_lengths.total"),
|
||||
last_value("vm.total_run_queue_lengths.cpu"),
|
||||
last_value("vm.total_run_queue_lengths.io")
|
||||
last_value("vm.total_run_queue_lengths.io"),
|
||||
|
||||
# Database Metrics
|
||||
last_value("music_library.repo.query.total_time",
|
||||
unit: {:native, :millisecond},
|
||||
description: "The sum of the other measurements"
|
||||
),
|
||||
last_value("music_library.repo.query.decode_time",
|
||||
unit: {:native, :millisecond},
|
||||
description: "The time spent decoding the data received from the database"
|
||||
),
|
||||
last_value("music_library.repo.query.query_time",
|
||||
unit: {:native, :millisecond},
|
||||
description: "The time spent executing the query"
|
||||
),
|
||||
last_value("music_library.repo.query.queue_time",
|
||||
unit: {:native, :millisecond},
|
||||
description: "The time spent waiting for a database connection"
|
||||
),
|
||||
last_value("music_library.repo.query.idle_time",
|
||||
unit: {:native, :millisecond},
|
||||
description:
|
||||
"The time the connection spent waiting before being checked out for the query"
|
||||
)
|
||||
]
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user