Metrics and attributes collected by the Splunk Distribution of OTel JS 🔗
The Splunk Distribution of OpenTelemetry JS collects runtime and custom metrics. To activate runtime metrics collection, see Metrics configuration.
To learn about the different metric types, see Metric types.
Activate metrics collection 🔗
To collect Node.js metrics, see Metrics configuration.
Runtime metrics 🔗
To activate runtime metrics, see Metrics configuration. The following example shows how to activate runtime metrics by passing the runtimeMetricsEnabled
argument to the start
method:
const { start } = require('@splunk/otel');
start({
serviceName: 'my-service',
metrics: {
runtimeMetricsEnabled: true,
}
});
The following runtime metrics are automatically collected and exported:
Metric |
Type |
Description |
---|---|---|
|
Gauge |
Heap total, in bytes. Extracted from |
|
Gauge |
Heap used, in bytes. Extracted from |
|
Gauge |
Resident set size, in bytes. Extracted from |
|
Cumulative counter |
Total collected by the garbage collector, in bytes. |
|
Cumulative counter |
Time spent by the garbage collector, in nanoseconds. |
|
Cumulative counter |
Number of garbage collector executions. |
|
Gauge |
Maximum event loop lag within the collection interval, in nanoseconds. |
|
Gauge |
Minimum event loop lag within the collection interval, in nanoseconds. |
Migrate from SignalFx metrics for Node.js 🔗
To migrate your custom metric instrumentation from the SignalFx client library, follow these steps:
Replace the
getSignalFxClient
dependency withopentelemetry/api-metrics
, and initialize metrics collection usingstart()
. For example:// SignalFx const { start } = require('@splunk/otel'); const { getSignalFxClient } = start({ serviceName: 'my-service' });
Becomes the following:
// OpenTelemetry const { start } = require('@splunk/otel'); const { metrics } = require('@opentelemetry/api-metrics'); start({ serviceName: 'my-service', metrics: true, // activate metrics with default configuration });
Replace calls to
getSignalFxClient()
with metrics instances. For example:// SignalFx getSignalFxClient().send({ gauges: [{ metric: 'cpu', value: 42, timestamp: 1442960607000}], cumulative_counters: [{ metric: 'clicks', value: 99, timestamp: 1442960607000}], })
Becomes the following:
// OpenTelemetry const meter = metrics.getMeter('my-meter'); meter.createObservableGauge('cpu', result => { result.observe(42); }); const counter = meter.createCounter('clicks'); counter.add(99);
Previous metric names 🔗
With the release of version 2.0 of the Splunk Distribution of OpenTelemetry JS, metric names changed to conform with OpenTelemetry conventions. The following table shows the equivalence between the current and previous metric names.
Current metric name |
Previous metric name |
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Debug metrics 🔗
To activate debug metrics, see Metrics configuration. Debug metrics are used for internal debugging purposes and to provide data to Splunk customer support.
The following example shows how to activate runtime metrics by passing the debugMetricsEnabled
argument to the start
method:
const { start } = require('@splunk/otel');
start({
serviceName: 'my-service',
metrics: {
debugMetricsEnabled: true,
}
});
The following runtime metrics are automatically collected and exported:
Metric |
Type |
Description |
---|---|---|
|
Histogram |
Time to start a new V8 profiling run. |
|
Histogram |
Time to stop a new V8 profiling run. |
|
Histogram |
Time spent matching span activations with stack traces and building the final output. |
|
Histogram |
Time to provide an alloxation profile through the V8 profiler. |
|
Histogram |
Time to traverse the call graph and build stack traces from the allocation samples. |