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

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

Open
morningspace opened this issue Nov 12, 2024 · 2 comments
Assignees

Comments

@morningspace
Copy link
Collaborator

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

This issue is to track the difference, including:

  • The different runtime metrics being collected by the two libraries.
  • The different ways being used to collect the runtime metrics.

The final goal is:

  • Build the integration package (the custom dashboards) for node.js runtime based on the combined view of the two runtime metrics sets.
  • Identify the gap between the two implementations. For those that are missed in the OpenTelemetry implementation, see if we can contribute back to the community.
@morningspace
Copy link
Collaborator Author

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
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants