Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Instrument with prometheus metrics #29

Merged
merged 3 commits into from Jul 12, 2019

Conversation

Projects
None yet
3 participants
@2color
Copy link
Contributor

commented Jun 14, 2019

What

  • Instrument with metrics for monitoring
  • Update docker image to use node v11 and follow best practices

Example metrics endpoint result

▶ curl localhost:3001/
# HELP process_cpu_user_seconds_total Total user CPU time spent in seconds.
# TYPE process_cpu_user_seconds_total counter
process_cpu_user_seconds_total 0.001174 1560524401787

# HELP process_cpu_system_seconds_total Total system CPU time spent in seconds.
# TYPE process_cpu_system_seconds_total counter
process_cpu_system_seconds_total 0.000057 1560524401787

# HELP process_cpu_seconds_total Total user and system CPU time spent in seconds.
# TYPE process_cpu_seconds_total counter
process_cpu_seconds_total 0.001231 1560524401787

# HELP process_start_time_seconds Start time of the process since unix epoch in seconds.
# TYPE process_start_time_seconds gauge
process_start_time_seconds 1560524402

# HELP process_resident_memory_bytes Resident memory size in bytes.
# TYPE process_resident_memory_bytes gauge
process_resident_memory_bytes 34635776 1560524401787

# HELP nodejs_eventloop_lag_seconds Lag of event loop in seconds.
# TYPE nodejs_eventloop_lag_seconds gauge
nodejs_eventloop_lag_seconds 0.452586091 1560524402240

# HELP nodejs_active_handles Number of active libuv handles grouped by handle type. Every handle type is C++ class name.
# TYPE nodejs_active_handles gauge
nodejs_active_handles{type="WriteStream"} 1 1560524401788

# HELP nodejs_active_handles_total Total number of active handles.
# TYPE nodejs_active_handles_total gauge
nodejs_active_handles_total 1 1560524401788

# HELP nodejs_active_requests Number of active libuv requests grouped by request type. Every request type is C++ class name.
# TYPE nodejs_active_requests gauge

# HELP nodejs_active_requests_total Total number of active requests.
# TYPE nodejs_active_requests_total gauge
nodejs_active_requests_total 0 1560524401788

# HELP nodejs_heap_size_total_bytes Process heap size from node.js in bytes.
# TYPE nodejs_heap_size_total_bytes gauge
nodejs_heap_size_total_bytes 14368768 1560524401788

# HELP nodejs_heap_size_used_bytes Process heap size used from node.js in bytes.
# TYPE nodejs_heap_size_used_bytes gauge
nodejs_heap_size_used_bytes 8638112 1560524401788

# HELP nodejs_external_memory_bytes Nodejs external memory size in bytes.
# TYPE nodejs_external_memory_bytes gauge
nodejs_external_memory_bytes 151128 1560524401788

# HELP nodejs_heap_space_size_total_bytes Process heap space size total from node.js in bytes.
# TYPE nodejs_heap_space_size_total_bytes gauge
nodejs_heap_space_size_total_bytes{space="read_only"} 524288 1560524401788
nodejs_heap_space_size_total_bytes{space="new"} 4194304 1560524401788
nodejs_heap_space_size_total_bytes{space="old"} 5967872 1560524401788
nodejs_heap_space_size_total_bytes{space="code"} 1048576 1560524401788
nodejs_heap_space_size_total_bytes{space="map"} 1060864 1560524401788
nodejs_heap_space_size_total_bytes{space="large_object"} 1572864 1560524401788
nodejs_heap_space_size_total_bytes{space="new_large_object"} 0 1560524401788

# HELP nodejs_heap_space_size_used_bytes Process heap space size used from node.js in bytes.
# TYPE nodejs_heap_space_size_used_bytes gauge
nodejs_heap_space_size_used_bytes{space="read_only"} 33520 1560524401788
nodejs_heap_space_size_used_bytes{space="new"} 1710312 1560524401788
nodejs_heap_space_size_used_bytes{space="old"} 5212192 1560524401788
nodejs_heap_space_size_used_bytes{space="code"} 866624 1560524401788
nodejs_heap_space_size_used_bytes{space="map"} 571360 1560524401788
nodejs_heap_space_size_used_bytes{space="large_object"} 249120 1560524401788
nodejs_heap_space_size_used_bytes{space="new_large_object"} 0 1560524401788

# HELP nodejs_heap_space_size_available_bytes Process heap space size available from node.js in bytes.
# TYPE nodejs_heap_space_size_available_bytes gauge
nodejs_heap_space_size_available_bytes{space="read_only"} 482064 1560524401788
nodejs_heap_space_size_available_bytes{space="new"} 352024 1560524401788
nodejs_heap_space_size_available_bytes{space="old"} 238864 1560524401788
nodejs_heap_space_size_available_bytes{space="code"} 0 1560524401788
nodejs_heap_space_size_available_bytes{space="map"} 64 1560524401788
nodejs_heap_space_size_available_bytes{space="large_object"} 1512349184 1560524401788
nodejs_heap_space_size_available_bytes{space="new_large_object"} 0 1560524401788

# HELP nodejs_version_info Node.js version info.
# TYPE nodejs_version_info gauge
nodejs_version_info{version="v11.13.0",major="11",minor="13",patch="0"} 1

# HELP up 1 = up, 0 = not up
# TYPE up gauge
up 1

# HELP nodejs_gc_runs_total Count of total garbage collections.
# TYPE nodejs_gc_runs_total counter
nodejs_gc_runs_total{gc_type="incremental_marking"} 1
nodejs_gc_runs_total{gc_type="mark_sweep_compact"} 1

# HELP nodejs_gc_pause_seconds_total Time spent in GC Pause in seconds.
# TYPE nodejs_gc_pause_seconds_total counter
nodejs_gc_pause_seconds_total{gc_type="incremental_marking"} 0.000056238
nodejs_gc_pause_seconds_total{gc_type="mark_sweep_compact"} 0.003391263

# HELP nodejs_gc_reclaimed_bytes_total Total number of bytes reclaimed by GC.
# TYPE nodejs_gc_reclaimed_bytes_total counter
nodejs_gc_reclaimed_bytes_total{gc_type="mark_sweep_compact"} 6873400

# HELP http_request_duration_seconds The HTTP request latencies in seconds.
# TYPE http_request_duration_seconds histogram
http_request_duration_seconds_bucket{le="0.05",method="get",status_code="503",path="/voting"} 1
http_request_duration_seconds_bucket{le="0.1",method="get",status_code="503",path="/voting"} 1
http_request_duration_seconds_bucket{le="0.3",method="get",status_code="503",path="/voting"} 1
http_request_duration_seconds_bucket{le="0.5",method="get",status_code="503",path="/voting"} 1
http_request_duration_seconds_bucket{le="0.8",method="get",status_code="503",path="/voting"} 1
http_request_duration_seconds_bucket{le="1",method="get",status_code="503",path="/voting"} 1
http_request_duration_seconds_bucket{le="1.5",method="get",status_code="503",path="/voting"} 1
http_request_duration_seconds_bucket{le="2",method="get",status_code="503",path="/voting"} 1
http_request_duration_seconds_bucket{le="3",method="get",status_code="503",path="/voting"} 1
http_request_duration_seconds_bucket{le="10",method="get",status_code="503",path="/voting"} 1
http_request_duration_seconds_bucket{le="+Inf",method="get",status_code="503",path="/voting"} 1
http_request_duration_seconds_sum{method="get",status_code="503",path="/voting"} 0.011196697
http_request_duration_seconds_count{method="get",status_code="503",path="/voting"} 1

# HELP http_requests_total The total HTTP requests.
# TYPE http_requests_total counter
http_requests_total{method="get",status_code="503",path="/voting"} 1

@2color 2color requested review from izqui and sohkai Jun 14, 2019

@sohkai

sohkai approved these changes Jul 5, 2019

Copy link
Member

left a comment

LGTM, let's get this upgraded!

@2color 2color referenced this pull request Jul 5, 2019

Open

Upgrade apm-serve #150

0 of 3 tasks complete
@izqui

izqui approved these changes Jul 8, 2019

@2color 2color merged commit 951d630 into master Jul 12, 2019

2 checks passed

WIP Ready for review
Details
license/cla Contributor License Agreement is signed.
Details

@2color 2color deleted the instrumnet-prometheus-metrics branch Jul 12, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.