Skip to content

Add /node/health endpoint#1197

Merged
paulhauner merged 9 commits intomasterfrom
health-endpoint
May 28, 2020
Merged

Add /node/health endpoint#1197
paulhauner merged 9 commits intomasterfrom
health-endpoint

Conversation

@paulhauner
Copy link
Member

@paulhauner paulhauner commented May 26, 2020

Issue Addressed

NA

Proposed Changes

Adds a /node/health endpoint with the following:

{
    "pid": 91115,
    "pid_num_threads": 30,
    "pid_mem_resident_set_size": 54931456,
    "pid_mem_virtual_memory_size": 2081447936,
    "sys_virt_mem_total": 16721076224,
    "sys_virt_mem_available": 7765610496,
    "sys_virt_mem_used": 8263913472,
    "sys_virt_mem_free": 3630616576,
    "sys_virt_mem_percent": 53.55795,
    "sys_loadavg_1": 5.14,
    "sys_loadavg_5": 4.22,
    "sys_loadavg_15": 3.34
}

Also exposes these metrics via Prometheus. Specifically it exposes process_resident_memory_bytes which should be useful for @Alethio's eth2-stats.

@paulhauner paulhauner added the work-in-progress PR is a work-in-progress label May 26, 2020
@paulhauner paulhauner added ready-for-review The code is ready for review low-hanging-fruit Easy to resolve, get it before someone else does! and removed work-in-progress PR is a work-in-progress labels May 26, 2020
@paulhauner paulhauner marked this pull request as ready for review May 26, 2020 09:02
@tzapu
Copy link

tzapu commented May 26, 2020

super cool to have this, great job

Copy link
Member

@michaelsproul michaelsproul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@michaelsproul michaelsproul added ready-to-squerge and removed ready-for-review The code is ready for review labels May 28, 2020
@paulhauner paulhauner merged commit ea4a529 into master May 28, 2020
@paulhauner paulhauner deleted the health-endpoint branch May 28, 2020 01:24
@adaszko
Copy link
Contributor

adaszko commented May 28, 2020

FYI, procinfo does not compile on macOS:

error[E0308]: mismatched types
   --> /Users/adaszko/.cargo/registry/src/github.com-1ecc6299db9ec823/procinfo-0.4.2/src/pid/status.rs:189:1
    |
189 | named!(parse_umask<mode_t>,     delimited!(tag!("Umask:\t"),     parse_u32_octal,    line_ending));
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `u16`, found `u32`
    |
    = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

@paulhauner
Copy link
Member Author

FYI, procinfo does not compile on macOS:

error[E0308]: mismatched types
   --> /Users/adaszko/.cargo/registry/src/github.com-1ecc6299db9ec823/procinfo-0.4.2/src/pid/status.rs:189:1
    |
189 | named!(parse_umask<mode_t>,     delimited!(tag!("Umask:\t"),     parse_u32_octal,    line_ending));
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `u16`, found `u32`
    |
    = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

This is being tracked here: #1215

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

low-hanging-fruit Easy to resolve, get it before someone else does!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants