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)

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 to false.
  • LAUNCHDARKLY_OTEL_NODE_ENABLE_OUTGOING_HTTP_INSTRUMENTATION enables outgoing HTTP instrumentation. It defaults to true. 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 is true.
  • The instruction is unaffected by the OTEL_NODE_ENABLED_INSTRUMENTATIONS and OTEL_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:

Plugin configuration options
1const client = init(
2 'sdk-key-123abc',
3 {
4 plugins: [
5 new Observability({
6 serviceName: 'example-service',
7 // we recommend setting serviceVersion to the latest deployed git SHA
8 serviceVersion: 'example-sha',
9 environment: 'production'
10 })
11 ]
12 }
13)

For a complete list of configuration options, read NodeOptions.