Skip to main content
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, or find your SDK under Observability SDKs. Details about each SDK’s configuration are available in the SDK-specific sections below:

Network requirements

The observability plugin sends OpenTelemetry data to LaunchDarkly at https://otel.observability.app.launchdarkly.com:4318 by default. Port 4318 is the standard OpenTelemetry HTTP/Protobuf port. If your network restricts outbound traffic to port 443, override the OTLP endpoint to use HTTPS on port 443. You have two ways to override the endpoint:
* Use the configuration option for your SDK. For example, in .NET, call WithOtlpEndpoint("https://otel.observability.app.launchdarkly.com:443") when you build the plugin.
* Set the OTEL_EXPORTER_OTLP_ENDPOINT environment variable to https://otel.observability.app.launchdarkly.com:443. This variable works with all server-side SDKs except Java. In Java, use the otlpEndpoint option.
If your application emits OpenTelemetry data locally but none of it appears in LaunchDarkly, check whether your network allows outbound traffic to port 4318. A restrictive firewall is a common cause of missing backend observability data.

Server-side SDKs

This feature is available in the observability plugin for the following server-side SDKs:

.NET (server-side)

You can configure the observability plugin for the .NET (server-side) SDK through a mix of environment variables, OpenTelemetry configuration options, and plugin configuration options.Use the ObservabilityPlugin.ObservabilityPluginBuilder to set the options. In many cases, you can use an OpenTelemetry-specific environment variable instead, if you prefer. For example, if you want to set a custom OTLP endpoint, you can either set OtlpEndpoint in your ObservabilityPlugin.ObservabilityPluginBuilder, or you can set the OTEL_EXPORTER_OTLP_ENDPOINT environment variable.Here’s how:
For a complete list of configuration options, read ObservabilityPlugin.ObservabilityPluginBuilder.

Go

You can configure the observability plugin for the Go SDK through the plugin’s options.Use the functions in the Option type to set the options.Here’s how:
For a complete list of configuration options, read Option.

Java

You can configure the observability plugin for the Java SDK through the plugin’s options. The Java plugin does not read OpenTelemetry environment variables such as OTEL_EXPORTER_OTLP_ENDPOINT or OTEL_SERVICE_NAME, so set these values through the plugin options instead.Use ObservabilityOptions.Builder to set the options.Here’s how:
This table lists the available options:
OptionDefaultDescription
enabledtrueWhen false, the plugin starts no providers, registers no flag evaluation hook, does not fetch sampling configuration, and LDObserve methods do nothing.
serviceNameEmptyThe service name, set as the service.name resource attribute.
serviceVersionEmptyThe service version, set as the service.version resource attribute.
environmentEmptyThe deployment environment name, set as the deployment.environment.name resource attribute.
otlpEndpointLaunchDarkly endpointA custom OTLP/HTTP endpoint.
backendUrlLaunchDarkly endpointA custom URL for fetching sampling configuration.
resourceAttributesEmptyAdditional resource attributes. These are merged over the plugin’s defaults, which means they can override service.name and other default attributes.
customHeaders, customHeaderNoneHeaders to send with every OTLP export and sampling configuration request.
proxySelector, proxyHostAndPortJava Virtual Machine (JVM) defaultAn egress proxy for exports and sampling configuration requests.
logsApiLevelINFOThe minimum severity of exported logs. NONE turns off log export.
debugfalseTurns on debug logging.
manualStartfalseDelays provider startup until you call LDObserve.start(sdkKey, options).
shutdownHooktrueFlushes and stops the providers from a JVM shutdown hook. Set this to false when a framework such as Spring Boot manages shutdown, and call LDObserve.shutdown() from its close callback.
The OTLP exporters and the sampling configuration request both use java.net.http.HttpClient, so they behave the same way behind an egress proxy. If you do not configure a proxy, the JVM default proxy selector applies. It honors the https.proxyHost, https.proxyPort, and http.nonProxyHosts system properties. To set a proxy or headers explicitly, use proxyHostAndPort and customHeader. To apply per-host proxy rules, pass a java.net.ProxySelector to proxySelector.Here’s how:
The available log levels are TRACE, DEBUG, INFO, WARN, ERROR, FATAL, and NONE, matching the OpenTelemetry severity numbers. The plugin treats a log record with no severity as TRACE.For a complete list of configuration options, read Configuration Options in the plugin README.

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:
For a complete list of configuration options, read NodeOptions.

Python

You can configure the observability plugin for the Python SDK through a mix of environment variables, OpenTelemetry configuration options, and plugin configuration options.Use the ObservabilityConfig class to set the options. In many cases, you can use an OpenTelemetry-specific environment variable instead, if you prefer. For example, if you want to set a custom OTLP endpoint, you can either set otlp_endpoint in your ObservabilityConfig, or you can set the OTEL_EXPORTER_OTLP_ENDPOINT environment variable.Here’s how:
For a complete list of configuration options, read ObservabilityConfig.

Ruby

You can configure options for the Ruby observability plugin when you initialize the SDK, or using environment variables.

Plugin configuration options

The plugin constructor accepts optional keyword arguments for configuration.Here’s how:
For a complete list of configuration options, read Plugin Options.

Environment variables

The environment variables specify where to enable instrumentation:
  • LAUNCHDARKLY_SDK_KEY provides the LaunchDarkly SDK key. This key is automatically extracted from the client during initialization.
  • OTEL_EXPORTER_OTLP_ENDPOINT provides a custom OTLP endpoint.
  • OTEL_SERVICE_NAME provides the service name, if not specified in plugin options.
Environment configuration is automaticThe environment associated with your SDK key is automatically determined by the backend, so you don’t need to configure it separately.