File-based configuration for Node.js in Splunk Observability Cloud

File‑based configuration provides a declarative way to configure Splunk OpenTelemetry for Node.js using a structured YAML file.

Overview

File‑based configuration provides a declarative, schema‑driven way to configure Splunk OpenTelemetry Auto‑Instrumentation for Node.js. . Instead of relying on environment variables, users define instrumentation behavior, exporters, processors, profiling, and Splunk‑specific extensions in a YAML configuration file. This approach centralizes configuration, improves maintainability, and aligns with the OpenTelemetry (OTel) declarative configuration model.
Important: This feature is currently experimental.

Declarative Configuration

Declarative configuration is enabled through a single environment variable and uses a structured configuration file validated against the OpenTelemetry Configuration Schema. When enabled, the configuration file becomes the authoritative source of configuration for the SDK and auto‑instrumentation.

Environment Variable

Name Description Default Type
OTEL_EXPERIMENTAL_CONFIG_FILE Path to the configuration file used to configure the SDK. When set, the configuration in this file takes precedence over all other SDK configuration environment variables. String

Activation

To enable file‑based configuration, set:

CODE
OTEL_EXPERIMENTAL_CONFIG_FILE=/path/to/config.yaml

When OTEL_EXPERIMENTAL_CONFIG_FILE is set:

  1. The file at the specified path is parsed into a configuration model.
  2. The model is used to create fully configured SDK components.
  3. All other SDK environment variables must be ignored, except those referenced inside the configuration file for environment variable substitution.

This ensures consistency between the structured configuration model and the flat environment variable model.

Customizing configuration models

Users may merge multiple configuration sources by:

  • parsing multiple configuration files and merging their models,

  • overlaying selected environment variables onto the parsed model,

  • applying custom logic before creating SDK components.

OpenTelemetry provides two reference configuration files:

  • otel-sdk-migration-config.yaml — includes environment variable substitution,

  • otel-sdk-config.yaml — a clean starting point without substitutions.

Starter Configuration Example

The example below illustrates a fully structured configuration file that can be used as a reference when enabling file‑based configuration for Splunk OpenTelemetry for Node.js.

CODE

Supported configuration fields

Splunk OpenTelemetry Auto‑Instrumentation for Node.js supports a subset of the OpenTelemetry configuration schema, along with several Splunk‑specific extensions. The fields listed below represent the configuration areas that the Node.js implementation can currently parse and apply when using a file‑based configuration file. Fields not included here are ignored or not yet implemented.

Core OTel configuration

These fields define general SDK behavior and metadata:

  • file_format — declares the schema version used by the configuration file

  • disabled — enables or disables auto‑instrumentation

  • log_level — controls SDK and instrumentation logging verbosity

  • resource.attributes — defines service metadata such as service name, version, and custom attributes

  • propagator — specifies which context propagation formats are enabled

Telemetry pipelines

These sections configure how traces, metrics, and logs are collected and exported:

  • tracer_provider — tracing processors, exporters, and sampling configuration

  • meter_provider — metric readers, exporters, and views

  • logger_provider — log processors and exporters

Instrumentation configuration

The instrumentation section allows configuring individual instrumentations and their settings directly in the configuration file. Availability of specific options depends on the instrumentation implementation.

Splunk extensions

Splunk provides additional configuration options under the distribution.splunk section. These extensions complement the standard OTel configuration model and enable Splunk‑specific functionality such as:

  • bundled instrumentations

  • runtime metrics

  • profiling (CPU, memory, callgraphs)

  • Splunk‑specific instrumentation settings

  • Splunk OTLP log exporter for profiling data