Skip to content

Commit b91b26f

Browse files
Merge pull request #2400 from splunk/pwilliams-o11ydocs-5993
Create framework for adding Node.js 3.0 docs changes
2 parents 42fb667 + dff3ed8 commit b91b26f

24 files changed

+1851
-136
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
.. _nodejs-3x-breaking-changes:
2+
3+
*****************************************************
4+
Splunk OpenTelemetry JS version 3.0 breaking changes
5+
*****************************************************
6+
7+
.. meta::
8+
:description: Learn about the latest changes for Splunk OpenTelemetry JS version 3.0.
9+
10+
Update to Splunk OpenTelemetry JS version 3.0
11+
==========================================================
12+
13+
To update your Splunk Distribution for OpenTelemetry JS agent to version 3.0, see :ref:`instrument-nodejs-applications-3x` and install the latest version of the Splunk OpenTelemetry JS agent.
14+
15+
Default port and protocol changes
16+
=================================
17+
18+
In the Node.js 3.x instrumentation, the default protocol changed from gRPC to http/protobuf.
19+
20+
If a custom configuration overrides the default endpoint setting, you must make sure of the following:
21+
22+
#. Verify that the Node.js agent configuration is correct:
23+
24+
#. Verify that you are using the correct port for the selected protocol:
25+
26+
* gRPC: 4317
27+
* http/protobuf: 4318
28+
29+
#. Verify that the custom endpoint configuration uses the correct port. For example: ``OTEL_EXPORTER_OTLP_ENDPOINT=http://<host>:4318``.
30+
31+
#. Verify that the custom protocol configuration uses the correct protocol. For example: ``OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf``.
32+
33+
#. In the OTel Collector configuration file, verify that the associated OTLP receiver protocols match those used by the Node.js agent. Here is an example OTLP receiver configuration in the OTel Collector file:
34+
35+
.. code-block:: yaml
36+
37+
otlp:
38+
protocols:
39+
grpc:
40+
endpoint: "${SPLUNK_LISTEN_INTERFACE}:4317"
41+
http:
42+
endpoint: "${SPLUNK_LISTEN_INTERFACE}:4318"
43+
44+
Troubleshooting
45+
======================
46+
47+
.. include:: /_includes/troubleshooting-components.rst

gdi/get-data-in/application/nodejs/configuration/advanced-nodejs-otel-configuration.rst

Lines changed: 30 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.. _advanced-nodejs-otel-configuration:
1+
.. _advanced-nodejs-otel-configuration-3x:
22

33
***************************************************************************
44
Configure the Splunk Distribution of OTel JS for Splunk Observability Cloud
@@ -11,7 +11,7 @@ You can configure the Splunk Distribution of OpenTelemetry JS to suit your instr
1111

1212
The following sections describe all available settings for configuring OpenTelemetry for Node.js, including options for activating new features that are unique to the Splunk Distribution of OpenTelemetry JS.
1313

14-
.. _configuration-methods-nodejs:
14+
.. _configuration-methods-nodejs-3x:
1515

1616
Configuration methods
1717
===========================================================
@@ -55,7 +55,7 @@ You can also activate the collection of a specific data type by passing a boolea
5555
5656
.. note:: Function arguments take precedence over the corresponding environment variables.
5757

58-
.. _main-nodejs-agent-settings:
58+
.. _main-nodejs-agent-settings-3x:
5959

6060
General settings
6161
=========================================================================
@@ -66,7 +66,7 @@ The following settings are specific to the Splunk Distribution of OpenTelemetry
6666

6767
<div class="instrumentation" section="settings" group="category" filter="general" url="https://raw.githubusercontent.com/splunk/o11y-gdi-metadata/main/apm/splunk-otel-js/metadata.yaml" data-renaming='{"keys": "Identifier", "description": "Description", "instrumented_components": "Components", "signals": "Signals", "env": "Environment variable", "default": "Default", "type": "Type", "property": "Argument to start()"}'></div>
6868

69-
.. _instrumentation-configuration-nodejs:
69+
.. _instrumentation-configuration-nodejs-3x:
7070

7171
Instrumentations configuration
7272
=======================================================
@@ -87,7 +87,7 @@ For example, to turn off all default instrumentations and only turn on the ``bun
8787
The previous settings only apply to instrumentations loaded by the Splunk Distribution of OpenTelemetry JS by default. When using the programmatic API to supply a list of user-specified instrumentations, they have no effect.
8888

8989

90-
.. _trace-configuration-nodejs:
90+
.. _trace-configuration-nodejs-3x:
9191

9292
Trace configuration
9393
=======================================================
@@ -107,7 +107,19 @@ The following settings control tracing limits and attributes:
107107
- ``serviceName``
108108
- Name of the service or application you're instrumenting. Takes precedence over the service name defined in the ``OTEL_RESOURCE_ATTRIBUTES`` variable.
109109
* - OTEL_RESOURCE_ATTRIBUTES
110-
- Not applicable
110+
- Use the ``resource`` method in the ``start()`` function to pass resource attributes. For example,
111+
112+
.. code-block:: js
113+
114+
import { start } from '@splunk/otel';
115+
import { Resource } from '@opentelemetry/resources';
116+
117+
start({
118+
serviceName: 'example',
119+
resource: (detectedResource) => {
120+
return detectedResource.merge(new Resource({ 'service.version': '0.2.0' }));
121+
},
122+
});
111123
- Comma-separated list of resource attributes added to every reported span. For example, ``key1=val1,key2=val2``.
112124
* - OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT
113125
- Not applicable
@@ -120,10 +132,10 @@ The following settings control tracing limits and attributes:
120132
- Maximum number of links per span. Default value is ``1000``.
121133
* - OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT
122134
- Not applicable
123-
- Maximum length of strings for attribute values. Values larger than the limit are truncated. Default value is ``1200``. Empty values are treated as infinity.
135+
- Maximum length of strings for attribute values. Values larger than the limit are truncated. Default value is ``12000``. Empty values are treated as infinity.
124136

125137

126-
.. _trace-sampling-settings-nodejs:
138+
.. _trace-sampling-settings-nodejs-3x:
127139

128140
Samplers configuration
129141
===============================================================
@@ -132,19 +144,21 @@ The following settings control trace sampling:
132144

133145
.. list-table::
134146
:header-rows: 1
135-
:widths: 30 70
147+
:widths: 20 40 40
136148
:width: 100%
137149

138150
* - Environment variable
139151
- Description
152+
- Default value
140153
* - OTEL_TRACES_SAMPLER
141154
- Sampler to use. The default value is ``parentbased_always_on``. Possible values are: ``always_on``, ``always_off``, ``parentbased_always_on``, ``parentbased_always_off``, ``traceidratio``, ``parentbased_traceidratio``. See :new-page:`Built-in samplers <https://github.com/open-telemetry/opentelemetry-js/blob/main/packages/opentelemetry-sdk-trace-base/README.md#built-in-samplers>` in the official OpenTelemetry documentation for more information.
142-
155+
- ``always_on``
143156
* - OTEL_TRACES_SAMPLER_ARG
144157
- Semicolon-separated list of rules for the ``rules`` sampler. For example, when setting the sampler to ``parentbased_traceidratio`` you can set the ratio using a number in the 0 to 1 range: |br| |br| ``OTEL_TRACES_SAMPLER_ARG=0.25``.
158+
- None
145159

146160

147-
.. _trace-exporters-settings-nodejs:
161+
.. _trace-exporters-settings-nodejs-3x:
148162

149163
Exporters configuration
150164
===============================================================
@@ -155,7 +169,7 @@ The following settings control trace exporters and their endpoints:
155169

156170
<div class="instrumentation" section="settings" group="category" filter="exporter" url="https://raw.githubusercontent.com/splunk/o11y-gdi-metadata/main/apm/splunk-otel-js/metadata.yaml" data-renaming='{"keys": "Identifier", "description": "Description", "instrumented_components": "Components", "signals": "Signals", "env": "Environment variable", "default": "Default", "type": "Type", "property": "Argument to start()"}'></div>
157171

158-
.. _jaeger-exporter-nodejs:
172+
.. _jaeger-exporter-nodejs-3x:
159173

160174
Jaeger exporter
161175
-------------------
@@ -180,7 +194,7 @@ To use the Jaeger exporter, add the ``@opentelemetry/exporter-jaeger`` package a
180194
181195
.. note:: To send data directly to Splunk Observability Cloud, see :ref:`export-directly-to-olly-cloud-nodejs`.
182196

183-
.. _trace-propagation-configuration-nodejs:
197+
.. _trace-propagation-configuration-nodejs-3x:
184198

185199
Propagators configuration
186200
=======================================================
@@ -203,7 +217,7 @@ For backward compatibility with the SignalFx Tracing Library for Node.js, use th
203217

204218
$env:OTEL_PROPAGATORS=b3multi
205219

206-
.. _profiling-configuration-nodejs:
220+
.. _profiling-configuration-nodejs-3x:
207221

208222
Node.js settings for AlwaysOn Profiling
209223
===============================================
@@ -228,7 +242,7 @@ To configure AlwaysOn Profiling programmatically, pass the arguments to the ``st
228242
229243
.. note:: For more information on AlwaysOn Profiling, see :ref:`profiling-intro`.
230244

231-
.. _metrics-configuration-nodejs:
245+
.. _metrics-configuration-nodejs-3x:
232246

233247
Metrics configuration
234248
===============================================================
@@ -241,22 +255,7 @@ The following settings activate runtime metrics collection:
241255

242256
.. note:: To pass settings as arguments, use the ``start()`` function.
243257

244-
Configuring an existing metrics client to send custom metrics
245-
---------------------------------------------------------------------
246-
247-
You can use an existing SignalFx client for sending custom metrics instead of creating and configuring a new one.
248-
249-
To configure an existing client, pass the following data to the ``start()`` function:
250-
251-
- ``signalfx``: A JavaScript object with optional ``client`` and ``dimensions`` fields. The ``dimensions`` object adds a predefined dimension for each data point. The format for ``dimensions`` is ``{key: value, ...}``.
252-
253-
The following is a list of dimensions added by default:
254-
255-
- ``service``: See ``serviceName`` in :ref:`trace-configuration-nodejs`.
256-
- ``metric_source``: ``splunk-otel-js``
257-
- ``node_version``: ``process.versions.node``, for example ``16.10.0``
258-
259-
.. _server-trace-information-nodejs:
258+
.. _server-trace-information-nodejs-3x:
260259

261260
Server trace information
262261
==============================================

gdi/get-data-in/application/nodejs/configuration/nodejs-otel-metrics.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.. _nodejs-otel-metrics:
1+
.. _nodejs-otel-metrics-3x:
22

33
**********************************************************************
44
Metrics and attributes collected by the Splunk Distribution of OTel JS
@@ -11,14 +11,14 @@ The Splunk Distribution of OpenTelemetry JS collects runtime and custom metrics.
1111

1212
To learn about the different metric types, see :ref:`metric-types`.
1313

14-
.. _enable-nodejs-metrics:
14+
.. _enable-nodejs-metrics-3x:
1515

1616
Activate metrics collection
1717
====================================================
1818

1919
To collect Node.js metrics, see :ref:`metrics-configuration-nodejs`.
2020

21-
.. _nodejs-otel-runtime-metrics:
21+
.. _nodejs-otel-runtime-metrics-3x:
2222

2323
Runtime metrics
2424
================================================
@@ -71,7 +71,7 @@ The following runtime metrics are automatically collected and exported:
7171
- Gauge
7272
- Minimum event loop lag within the collection interval, in nanoseconds.
7373

74-
.. _nodejs-otel-metrics-migration:
74+
.. _nodejs-otel-metrics-migration-3x:
7575

7676
Migrate from SignalFx metrics for Node.js
7777
===========================================
@@ -150,7 +150,7 @@ With the release of version 2.0 of the Splunk Distribution of OpenTelemetry JS,
150150
* - ``process.runtime.nodejs.event_loop.lag.min``
151151
- ``nodejs.event_loop.lag.min``
152152

153-
.. _nodejs-otel-debug-metrics:
153+
.. _nodejs-otel-debug-metrics-3x:
154154

155155
Debug metrics
156156
=====================================

gdi/get-data-in/application/nodejs/get-started.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.. _get-started-nodejs:
1+
.. _get-started-nodejs-3x:
22

33
***************************************************************
44
Instrument Node.js applications for Splunk Observability Cloud
@@ -19,7 +19,11 @@ Instrument Node.js applications for Splunk Observability Cloud
1919
Performance overhead <performance>
2020
Troubleshoot the Node.js agent <troubleshooting/common-nodejs-troubleshooting>
2121
About Splunk OTel JS <splunk-nodejs-otel-distribution>
22+
Node.js 3.0 breaking changes <breaking-changes>
2223
Migrate from the SFx Tracing Library <troubleshooting/migrate-signalfx-nodejs-agent-to-otel>
24+
Version 2.X (deprecated) <version2x/get-started>
25+
26+
.. note:: The Splunk OpenTelemetry JS version 3.0 contains a set of breaking changes. To view these changes and learn how to update to version 3.0, see :ref:`nodejs-3x-breaking-changes`.
2327

2428
The Splunk Distribution of OpenTelemetry JS provides a Node.js SDK that automatically adds APM instrumentation to your Node.js application. The instrumentation captures traces, runtime metrics, and CPU and memory profiles and sends them to Splunk Observability Cloud.
2529

gdi/get-data-in/application/nodejs/instrumentation/connect-traces-logs.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.. _correlate-traces-with-logs-nodejs:
1+
.. _correlate-traces-with-logs-nodejs-3x:
22

33
*******************************************************************
44
Connect Node.js trace data with logs for Splunk Observability Cloud
@@ -9,7 +9,7 @@ Connect Node.js trace data with logs for Splunk Observability Cloud
99

1010
You can configure Node.js logging libraries to include tracing attributes provided automatically by the Splunk Distribution of OpenTelemetry JS. Use the trace metadata to correlate traces with log events and explore Node.js application logs in Splunk Observability Cloud.
1111

12-
.. _nodejs-traces-logs-requirements:
12+
.. _nodejs-traces-logs-requirements-3x:
1313

1414
Supported logging libraries
1515
=====================================================
@@ -20,14 +20,14 @@ The Splunk Distribution of OpenTelemetry JS automatically supports the following
2020
- Pino
2121
- Winston
2222

23-
.. _nodejs-traces-logs-enable:
23+
.. _nodejs-traces-logs-enable-3x:
2424

2525
Activate logs injection
2626
=====================================================
2727

2828
Log injection is already activated for the supported libraries. To inject trace data into formatted logs, see the documentation for each library.
2929

30-
.. _nodejs-include-trace-data:
30+
.. _nodejs-include-trace-data-3x:
3131

3232
Include trace metadata in log statements
3333
===================================================

0 commit comments

Comments
 (0)