ProductPromotion
Logo

Elixir

made by https://0x3d.site

GitHub - deadtrickster/prometheus_process_collector: Prometheus.io process collector in Erlang
Prometheus.io process collector in Erlang. Contribute to deadtrickster/prometheus_process_collector development by creating an account on GitHub.
Visit Site

GitHub - deadtrickster/prometheus_process_collector: Prometheus.io process collector in Erlang

GitHub - deadtrickster/prometheus_process_collector: Prometheus.io process collector in Erlang

Prometheus.io Process Collector

Hex.pm Hex.pm Build Status

Collector which exports the current state of process metrics including cpu, memory, file descriptor usage and native threads count as well as the process start and up times.

  • FreeBSD;
  • Linux - uses /proc;
  • MacOS X (expiremental).

Installation

Hex package note: Because OTP strictly validates NIF version c_src was compiled with, I removed precompiled binaries from the Hex package. This means that OTP source code is needed to build this library.

Also collector needs to be registered (for example in default registry):

prometheus_registry:register_collector(prometheus_process_collector)
require Prometheus.Registry
Prometheus.Registry.register_collector(:prometheus_process_collector)

Example scrape:

# TYPE process_open_fds gauge
# HELP process_open_fds Number of open file descriptors.
process_open_fds 13
# TYPE process_max_fds gauge
# HELP process_max_fds Maximum number of open file descriptors.
process_max_fds 20000
# TYPE process_start_time_seconds gauge
# HELP process_start_time_seconds Start time of the process since unix epoch in seconds.
process_start_time_seconds 1508230997
# TYPE process_uptime_seconds counter
# HELP process_uptime_seconds Process uptime in seconds.
process_uptime_seconds 76
# TYPE process_threads_total gauge
# HELP process_threads_total Process Threads count.
process_threads_total 22
# TYPE process_virtual_memory_bytes gauge
# HELP process_virtual_memory_bytes Virtual memory size in bytes.
process_virtual_memory_bytes 3015249920
# TYPE process_resident_memory_bytes gauge
# HELP process_resident_memory_bytes Resident memory size in bytes.
process_resident_memory_bytes 1224400
# TYPE process_cpu_seconds_total counter
# HELP process_cpu_seconds_total Process CPU seconds total.
process_cpu_seconds_total{kind="utime"} 0.768
process_cpu_seconds_total{kind="stime"} 0.368
# TYPE process_max_resident_memory_bytes gauge
# HELP process_max_resident_memory_bytes Maximum resident set size used.
process_max_resident_memory_bytes 50192384
# TYPE process_noio_pagefaults_total counter
# HELP process_noio_pagefaults_total Number of page faules serviced without any I/O activity.
process_noio_pagefaults_total 16015
# TYPE process_io_pagefaults_total counter
# HELP process_io_pagefaults_total Number of page faults serviced that required I/O activity.
process_io_pagefaults_total 0
# TYPE process_swaps_total counter
# HELP process_swaps_total Number of times a process was "swapped" out of main memory.
process_swaps_total 0
# TYPE process_disk_reads_total counter
# HELP process_disk_reads_total Number of times the file system had to perform input.
process_disk_reads_total 0
# TYPE process_disk_writes_total counter
# HELP process_disk_writes_total Number of times the file system had to perform output.
process_disk_writes_total 80
# TYPE process_signals_delivered_total counter
# HELP process_signals_delivered_total Number of signals delivered.
process_signals_delivered_total 0
# TYPE process_voluntary_context_switches_total counter
# HELP process_voluntary_context_switches_total Number of times a context switch resulted due to a process voluntarily giving up the processor.
process_voluntary_context_switches_total 1131
# TYPE process_involuntary_context_switches_total counter
# HELP process_involuntary_context_switches_total Number of times a context switch resulted due to a higher priority process becoming runnable or because the current process exceeded its time slice.
process_involuntary_context_switches_total 208

Usage

You can register this collector manually using prometheus_process_collector/0,1 or use default_collectors env entry for prometheus.

With Prometheus Plugs - just add prometheus_process_collector dependency to top-level project (i.e. like here).

Integrations / Collectors / Instrumenters

Build

$ rebar3 compile

License

FreeBSD-specific part uses copy-modified code from standard utils (limits and procstat) or standard API in some places.

MIT

Articles
to learn more about the elixir concepts.

Resources
which are currently available to browse on.

mail [email protected] to add your project or resources here 🔥.

FAQ's
to know more about the topic.

mail [email protected] to add your project or resources here 🔥.

Queries
or most google FAQ's about Elixir.

mail [email protected] to add more queries here 🔍.

More Sites
to check out once you're finished browsing here.

0x3d
https://www.0x3d.site/
0x3d is designed for aggregating information.
NodeJS
https://nodejs.0x3d.site/
NodeJS Online Directory
Cross Platform
https://cross-platform.0x3d.site/
Cross Platform Online Directory
Open Source
https://open-source.0x3d.site/
Open Source Online Directory
Analytics
https://analytics.0x3d.site/
Analytics Online Directory
JavaScript
https://javascript.0x3d.site/
JavaScript Online Directory
GoLang
https://golang.0x3d.site/
GoLang Online Directory
Python
https://python.0x3d.site/
Python Online Directory
Swift
https://swift.0x3d.site/
Swift Online Directory
Rust
https://rust.0x3d.site/
Rust Online Directory
Scala
https://scala.0x3d.site/
Scala Online Directory
Ruby
https://ruby.0x3d.site/
Ruby Online Directory
Clojure
https://clojure.0x3d.site/
Clojure Online Directory
Elixir
https://elixir.0x3d.site/
Elixir Online Directory
Elm
https://elm.0x3d.site/
Elm Online Directory
Lua
https://lua.0x3d.site/
Lua Online Directory
C Programming
https://c-programming.0x3d.site/
C Programming Online Directory
C++ Programming
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
R Programming
https://r-programming.0x3d.site/
R Programming Online Directory
Perl
https://perl.0x3d.site/
Perl Online Directory
Java
https://java.0x3d.site/
Java Online Directory
Kotlin
https://kotlin.0x3d.site/
Kotlin Online Directory
PHP
https://php.0x3d.site/
PHP Online Directory
React JS
https://react.0x3d.site/
React JS Online Directory
Angular
https://angular.0x3d.site/
Angular JS Online Directory