Search…
⌃K
Links

NodeJS

Setup

The Prometheus NodeJS Exporter needs to be set up. For e.g.
const client = require('prom-client');
const collectDefaultMetrics = client.collectDefaultMetrics;
const Registry = client.Registry;
const register = new Registry();
collectDefaultMetrics({ register })

Metrics and Key Performance Indicators (KPIs)

Metric
KPI
Memory
process_resident_memory_bytes
Utilization in k8s
process_resident_memory_bytes / kube_node_status_allocatable{resource="memory"}
Utilization in non k8s
process_resident_memory_bytes / node_memory_MemTotal_bytes
CPU
process_cpu_seconds_total
Utilization in k8s
rate(process_cpu_seconds_total[5m]) / kube_pod_container_resource_limits{resource="cpu"}
Utilization in non k8s
rate(process_cpu_seconds_total[5m]) / rate(node_cpu_seconds_total[5m])

Dashboard

In addition to the above KPIs, the following NodeJS runtime metrics are visualized in the KPI Dashboard

Heap Usage

  • nodejs_heap_size_total_bytes
  • nodejs_heap_size_used_bytes
  • nodejs_heap_space_size_used_bytes

Event loop Latency

  • nodejs_eventloop_lag_seconds
  • nodejs_eventloop_lag_p99_seconds

GC Duration and Count

  • rate(nodejs_gc_duration_seconds_sum[5m])
  • rate(nodejs_gc_duration_seconds_count[5m])

Active Handles and Requests

  • nodejs_active_handles_total
  • nodejs_active_reqeuests_total

File Handles

  • process_open_fds
  • process_max_fds

Dashboard

Last modified 25d ago