Configuration for server-side observability
Overview
This topic explains how to configure the observability plugin for server-side SDKs.
The observability plugin collects and sends observability data to LaunchDarkly, so you can review error monitoring, logs, traces, and more from within the LaunchDarkly UI.
To get started with the observability plugin, read the observability reference guide for your SDK. Use the docs site navigation on the left, or find your SDK under SDKs with observability support.
Details about each SDK’s configuration are available in the SDK-specific sections below:
Server-side SDKs
This feature is available in the observability plugin for the following server-side SDKs:
Node.js (server-side)
Expand Node.js (server-side) code sample
You can configure the observability plugin for the Node.js (server-side) SDK through a mix of environment variables, OpenTelemetry configuration options, and plugin configuration options.
Environment variables
The environment variables specify where to enable instrumentation:
LAUNCHDARKLY_OTEL_NODE_ENABLE_FILESYSTEM_INSTRUMENTATION
enables file system instrumentation. It defaults tofalse
.LAUNCHDARKLY_OTEL_NODE_ENABLE_OUTGOING_HTTP_INSTRUMENTATION
enables outgoing HTTP instrumentation. It defaults totrue
. It only affects outgoing HTTP requests instrumented by@opentelemetry/instrumentation-http
.
OpenTelemetry configuration options
If you are already using OpenTelemetry configuration options for Node in your application, you can continue to use them.
When you use the observability plugin, the @opentelemetry/instrumentation-fs
instrumentation behaves as follows:
- The instrumentation will only be enabled if
LAUNCHDARKLY_OTEL_NODE_ENABLE_FILESYSTEM_INSTRUMENTATION
istrue
. - The instruction is unaffected by the
OTEL_NODE_ENABLED_INSTRUMENTATIONS
andOTEL_NODE_DISABLED_INSTRUMENTATIONS
OpenTelemetry environment variables.
Plugin configuration options
To specify the observability plugin configuration options, use the NodeOptions
interface to set the options.
Here’s how:
For a complete list of configuration options, read NodeOptions
.