Skip to content

Commit

Permalink
⭐ prometheus process collector 추가
Browse files Browse the repository at this point in the history
- os 정보를 수집한다
  - cpu
  - memory
  - file descriptor usage
  - native threads count
  - process start and up times
  • Loading branch information
ohyecloudy committed Feb 4, 2020
1 parent 16ca0af commit eb30565
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions lib/ppg/application.ex
Expand Up @@ -5,8 +5,11 @@ defmodule Ppg.Application do

use Application

require Prometheus.Registry

def start(_type, _args) do
Ppg.Metrics.Setup.setup()
Prometheus.Registry.register_collector(:prometheus_process_collector)

# List all child processes to be supervised
children = [
Expand Down
3 changes: 2 additions & 1 deletion mix.exs
Expand Up @@ -40,7 +40,8 @@ defmodule Ppg.MixProject do
{:jason, "~> 1.0"},
{:plug_cowboy, "~> 2.0"},
{:prometheus_ex, "~> 3.0"},
{:prometheus_plugs, "~> 1.1"}
{:prometheus_plugs, "~> 1.1"},
{:prometheus_process_collector, "~> 1.4"}
]
end
end
1 change: 1 addition & 0 deletions mix.lock
Expand Up @@ -16,6 +16,7 @@
"prometheus": {:hex, :prometheus, "4.5.0", "8f4a2246fe0beb50af0f77c5e0a5bb78fe575c34a9655d7f8bc743aad1c6bf76", [:mix, :rebar3], [], "hexpm"},
"prometheus_ex": {:hex, :prometheus_ex, "3.0.5", "fa58cfd983487fc5ead331e9a3e0aa622c67232b3ec71710ced122c4c453a02f", [:mix], [{:prometheus, "~> 4.0", [hex: :prometheus, repo: "hexpm", optional: false]}], "hexpm"},
"prometheus_plugs": {:hex, :prometheus_plugs, "1.1.5", "25933d48f8af3a5941dd7b621c889749894d8a1082a6ff7c67cc99dec26377c5", [:mix], [{:accept, "~> 0.1", [hex: :accept, repo: "hexpm", optional: false]}, {:plug, "~> 1.0", [hex: :plug, repo: "hexpm", optional: false]}, {:prometheus_ex, "~> 1.1 or ~> 2.0 or ~> 3.0", [hex: :prometheus_ex, repo: "hexpm", optional: false]}, {:prometheus_process_collector, "~> 1.1", [hex: :prometheus_process_collector, repo: "hexpm", optional: true]}], "hexpm"},
"prometheus_process_collector": {:hex, :prometheus_process_collector, "1.4.5", "9baea93f5d8c2758dbad0de021ef74438d2f81a01d1f24f5ef0bb949a7b4191d", [:rebar3], [{:prometheus, "~> 4.0", [hex: :prometheus, repo: "hexpm", optional: false]}], "hexpm"},
"ranch": {:hex, :ranch, "1.7.1", "6b1fab51b49196860b733a49c07604465a47bdb78aa10c1c16a3d199f7f8c881", [:rebar3], [], "hexpm"},
"telemetry": {:hex, :telemetry, "0.4.1", "ae2718484892448a24470e6aa341bc847c3277bfb8d4e9289f7474d752c09c7f", [:rebar3], [], "hexpm"},
}

0 comments on commit eb30565

Please sign in to comment.