instana / observability-as-code

Codifying and automating the configuration, deployment, and maintenance of monitoring systems
0 stars 0 forks source link

Compare Instana Node.js collector vs. OpenTelemetry JavaScript instrumentation library for runtime metrics #12

Open morningspace opened 1 week ago

morningspace commented 1 week ago

For runtime metrics, Instana has its own implementation, which is different from the OpenTelemetry implementation.

This issue is to track the difference, including:

The final goal is:

morningspace commented 1 week ago

The OpenTelemetry Node.js runtime instrumentation implementation can be found at: https://github.com/open-telemetry/opentelemetry-js-contrib/blob/main/plugins/node/instrumentation-runtime-node/README.md

liyanwei93 commented 1 week ago

Metircs in Instana Nodejs

Metrics Name Description Unit Retrieval Method
gc.gcPause GC Pause MILLIS stats.end - stats.start (nativeModuleName: 'gcstats.js')
gc.minorGcs Minor GCs NUMBER stats.gctype (nativeModuleName: 'gcstats.js')
gc.majorGcs Major GCs NUMBER stats.gctype (nativeModuleName: 'gcstats.js')
gc.usedHeapSizeAfterGc Heap Size After GC BYTES stats.after.usedHeapSize (nativeModuleName: 'gcstats.js')
activeHandles Handles NUMBER process._getActiveHandles
activeRequests Requests NUMBER process._getActiveRequests
memory.rss RSS BYTES process.memoryUsage.rss
memory.heapUsed Heap Size BYTES process.memoryUsage.heapUsed
libuv.max Longest time in single loop MILLIS eventLoopStats.sense() (nativeModuleName: 'event-loop-stats')
libuv.sum Total time in loop MILLIS eventLoopStats.sense() (nativeModuleName: 'event-loop-stats')
libuv.lag Event loop lag MILLIS eventLoopStats.sense() (nativeModuleName: 'event-loop-stats')
libuv.num Loops per second NUMBER eventLoopStats.sense() (nativeModuleName: 'event-loop-stats')
heapSpaces.used Heap Spaces Used BYTES v8.getHeapSpaceStatistics().space_used_size
heapSpaces.available Heap Spaces Available BYTES v8.getHeapSpaceStatistics().space_available_size
heapSpaces.current Heap Spaces Current BYTES v8.getHeapSpaceStatistics().space_size
heapSpaces.physical Heap Spaces Physical BYTES v8.getHeapSpaceStatistics().physical_space_size

Metircs in opentelemetry Nodejs with @opentelemetry/instrumentation-runtime-node

Metrics Name Description Unit Retrieval Method
v8js.gc.duration{v8js.gc.type="minor"} Garbage collection duration by kind, one of major, minor, incremental, or weakcb N/A perf_hooks.PerformanceObserver
nodejs.eventloop.delay.max Event loop maximum delay N/A perf_hooks.monitorEventLoopDelay.histogram.max
nodejs.eventloop.delay.mean Event loop mean delay N/A perf_hooks.monitorEventLoopDelay.histogram.mean
nodejs.eventloop.delay.min Event loop minimum delay N/A perf_hooks.monitorEventLoopDelay.histogram.min
nodejs.eventloop.delay.p50 Event loop 50th percentile delay N/A perf_hooks.monitorEventLoopDelay.histogram.percentile(50)
nodejs.eventloop.delay.p90 Event loop 90th percentile delay N/A perf_hooks.monitorEventLoopDelay.histogram.percentile(90)
nodejs.eventloop.delay.p99 Event loop 99th percentile delay N/A perf_hooks.monitorEventLoopDelay.histogram.percentile(99)
nodejs.eventloop.delay.stddev Event loop standard deviation delay N/A perf_hooks.monitorEventLoopDelay.histogram.stddev
nodejs.eventloop.time Cumulative duration of time the event loop has been in each state N/A perf_hooks.eventLoopUtilizationCollector.active & idle
nodejs.eventloop.utilization Event loop utilization N/A perf_hooks.eventLoopUtilizationCollector._lastValue.utilization
v8js.memory.heap.limit{v8js.heap.space.name} Total heap memory size pre-allocated N/A v8.getHeapSpaceStatistics().space_size
v8js.memory.heap.space.available_size{v8js.heap.space.name} Heap space available size N/A v8.getHeapSpaceStatistics().space_available_size
v8js.memory.heap.space.physical_size{v8js.heap.space.name} Committed size of a heap space. N/A v8.getHeapSpaceStatistics().physical_space_size
v8js.memory.heap.used{v8js.heap.space.name} Heap memory size allocated N/A v8.getHeapSpaceStatistics().space_used_size

Summary

libuv.max ≈ nodejs.eventloop.delay.max: Max loop time/delay libuv.sum ≈ nodejs.eventloop.time: Cumulative time in the event loop libuv.lag ≈ nodejs.eventloop.delay.mean: Average delay

heapSpaces.used ≈ v8js.memory.heap.used heapSpaces.available ≈ v8js.memory.heap.space.available_size heapSpaces.current ≈ v8js.memory.heap.limit heapSpaces.physical ≈ v8js.memory.heap.space.physical_size