Métriques de runtime NodeJS
Rapport de recherche Datadog : Bilan sur l'adoption de l'informatique sans serveur Rapport : Bilan sur l'adoption de l'informatique sans serveur

Métriques de runtime NodeJS

Cette fonctionnalité est actuellement en version bêta privée. Contactez l'assistance afin de demander son activation pour votre compte.

Configuration automatique

Il est possible d’activer la collecte de métriques runtime en définissant un paramètre de configuration dans le client de tracing, soit via l’option de traceur tracer.init({ runtimeMetrics: true }), soit via la variable d’environnement DD_RUNTIME_METRICS_ENABLED=true

Les métriques runtime peuvent être visualisées conjointement à vos services Node. Consultez la page Service dans Datadog.

Par défaut, les métriques runtime de votre application sont envoyées à l’Agent Datadog par le biais de DogStatsD sur le port 8125. Veillez à ce que DogStatsD soit activé pour l’Agent. Si vous exécutez l’Agent en tant que conteneur, assurez-vous que DD_DOGSTATSD_NON_LOCAL_TRAFFIC est défini sur true et que le port 8125 est ouvert sur l’Agent. Dans Kubernetes, associez le port DogstatsD à un port de host ; dans ECS, indiquez les flags pertinents dans la définition de votre tâche.

Données collectées

Les métriques suivantes sont recueillies par défaut après l’activation des métriques runtime.

runtime.node.cpu.user
(gauge)
CPU usage in user code
Shown as percent
runtime.node.cpu.system
(gauge)
CPU usage in system code
Shown as percent
runtime.node.cpu.total
(gauge)
Total CPU usage
Shown as percent
runtime.node.mem.rss
(gauge)
Resident set size
Shown as byte
runtime.node.mem.heap_total
(gauge)
Total heap memory
Shown as byte
runtime.node.mem.heap_used
(gauge)
Heap memory usage
Shown as byte
runtime.node.mem.external
(gauge)
External memory
Shown as byte
runtime.node.heap.total_heap_size
(gauge)
Total heap size
Shown as byte
runtime.node.heap.total_heap_size_executable
(gauge)
Total executable heap size
Shown as byte
runtime.node.heap.total_physical_size
(gauge)
Total physical heap size
Shown as byte
runtime.node.heap.used_heap_size
(gauge)
Used heap size
Shown as byte
runtime.node.heap.heap_size_limit
(gauge)
Heap size limit
Shown as byte
runtime.node.heap.malloced_memory
(gauge)
Malloced memory
Shown as byte
runtime.node.heap.peak_malloced_memory
(gauge)
Peak allocated memory
Shown as byte
runtime.node.heap.size.by.space
(gauge)
Heap space size
Shown as byte
runtime.node.heap.used_size.by.space
(gauge)
Heap space used size
Shown as byte
runtime.node.heap.available_size.by.space
(gauge)
Heap space available size
Shown as byte
runtime.node.heap.physical_size.by.space
(gauge)
Heap space physical size
Shown as byte
runtime.node.process.uptime
(gauge)
Process uptime
Shown as second
runtime.node.event_loop.delay.max
(gauge)
Maximum event loop delay
Shown as nanosecond
runtime.node.event_loop.delay.min
(gauge)
Minimum event loop delay
Shown as nanosecond
runtime.node.event_loop.delay.avg
(gauge)
Average event loop delay
Shown as nanosecond
runtime.node.event_loop.delay.sum
(rate)
Total event loop delay
Shown as nanosecond
runtime.node.event_loop.delay.median
(gauge)
Median event loop delay
Shown as nanosecond
runtime.node.event_loop.delay.95percentile
(gauge)
95th percentile event loop delay
Shown as nanosecond
runtime.node.event_loop.delay.count
(rate)
Event loop iterations count
Shown as execution
runtime.node.gc.pause.max
(gauge)
Maximum garbage collection pause
Shown as nanosecond
runtime.node.gc.pause.min
(gauge)
Minimum garbage collection pause
Shown as nanosecond
runtime.node.gc.pause.avg
(gauge)
Average garbage collection pause
Shown as nanosecond
runtime.node.gc.pause.sum
(rate)
Total garbage collection pause
Shown as nanosecond
runtime.node.gc.pause.median
(gauge)
Median garbage collection pause
Shown as nanosecond
runtime.node.gc.pause.95percentile
(gauge)
95th percentile garbage collection pause
Shown as nanosecond
runtime.node.gc.pause.count
(rate)
Number of garbage collections
Shown as garbage collection
runtime.node.gc.pause.by.type.max
(gauge)
Maximum garbage collection pause by type
Shown as nanosecond
runtime.node.gc.pause.by.type.min
(gauge)
Minimum garbage collection pause by type
Shown as nanosecond
runtime.node.gc.pause.by.type.avg
(gauge)
Average garbage collection pause by type
Shown as nanosecond
runtime.node.gc.pause.by.type.sum
(rate)
Total garbage collection pause by type
Shown as nanosecond
runtime.node.gc.pause.by.type.median
(gauge)
Median garbage collection pause by type
Shown as nanosecond
runtime.node.gc.pause.by.type.95percentile
(gauge)
95th percentile garbage collection pause by type
Shown as nanosecond
runtime.node.gc.pause.by.type.count
(rate)
Number of garbage collections by type
Shown as garbage collection
runtime.node.spans.finished
(gauge)
Number of finished spans held in memory
Shown as instance
runtime.node.spans.finished.by.name
(gauge)
Number of finished spans held in memory by span name
Shown as instance
runtime.node.spans.unfinished
(gauge)
Number of unfinished spans held in memory
Shown as instance
runtime.node.spans.unfinished.by.name
(gauge)
Number of unfinished spans held in memory by span name
Shown as instance
runtime.node.async.resources
(gauge)
Number of asynchronous resources held in memory
Shown as resource
runtime.node.async.resources.by.type
(gauge)
Number of asynchronous resources held in memory
Shown as resource

Datadog fournit non seulement ces métriques sur votre page Service de l’APM, mais également un dashboard de runtime Node par défaut comportant les tags service et runtime-id appliqués à ces métriques.

Pour aller plus loin