Remote configuration for AlwaysOn Profiling
Learn about remote configuration for AlwaysOn Profiling, including prerequisites, supported languages and variables, permissions, and API information.
The remote configuration for the AlwaysOn Profiling feature lets you configure AlwaysOn Profiling remotely from the Splunk Observability Cloud UI and API without changing deployment configuration or restarting applications.
You can perform on-demand performance diagnostics without redeploying applications. This helps reduce mean time to diagnosis (MTTD) during incidents.
Open Agent Management Protocol (OpAMP) delivers remote configuration for the AlwaysOn Profiling capability to supported Splunk OpenTelemetry agents.
Prerequisites
Configure OpAMP for Collector
Configure the OpenTelemetry Collector to connect to the OpAMP server and enable remote configuration.
Configure OpAMP for the OpenTelemetry Collector by adding extensions to the agent_config.yaml configuration file and restarting the Collector.
Remote configuration for AlwaysOn Profiling for Java agent
Configure OpAMP remote configuration for the Java agent with environment variables or file-based settings, and review sample profiling payloads.
Using environment variables
You can enable OpAMP remote configuration for the Java agent with the following environment variables:
| Environment variable | Description | Default | Required | Type | System property |
|---|---|---|---|---|---|
SPLUNK_OPAMP_ENABLED |
Set to true to connect to an OpAMP server. |
false |
Yes | boolean | splunk.opamp.enabled |
SPLUNK_OPAMP_ENDPOINT |
The URL of the OpAMP server that you want to connect to. | - | Yes | string | splunk.opamp.endpoint |
SPLUNK_OPAMP_REMOTE_CONFIG |
Set to true to enable remote configuration features. |
false | Yes | boolean | splunk.opamp.remote.config |
SPLUNK_OPAMP_POLLING_INTERVAL |
Number of milliseconds between agent-to-server polls. | 30000 |
Optional | int | splunk.opamp.polling.interval |
If required, configure the agent’s initial profiling settings using the environment variables or system properties. See Java settings for AlwaysOn Profiling.
Using file-based configuration
You can enable OpAMP remote configuration in the agent’s declarative configuration file. Set OTEL_CONFIG_FILE to the path of that file:
OTEL_CONFIG_FILE=/path/to/agent-config.yaml
Add the following configuration to the startup YAML file:
distribution:
splunk:
opamp/development:
endpoint: <URL of the OpAMP server>
polling_interval: 30000
features:
remote_config:
Configure the initial profiling settings of the agent in the startup YAML. See File-based configuration for Java in Splunk Observability Cloud.
Sample payload
After you enable OpAMP remote configuration, the OpAMP server sends profiling settings to the agent. The remote payload uses the splunk.remote.config key and application/yaml content type. This is a server-sent payload, separate from the agent’s environment variables and system properties. For more information, see Open Agent Management Protocol specification.
For example, this payload enables CPU profiling with a sampling interval of 1001 milliseconds and memory profiling:
distribution:
splunk:
profiling:
always_on:
cpu_profiler:
sampling_interval: 1001
memory_profiler:
This payload enables snapshot profiling:
distribution:
splunk:
profiling:
callgraphs:
sampling_interval: 10
selection_probability: 0.01
Including cpu_profiler, memory_profiler, or callgraphs enables the corresponding profiler. Omitting one of these sections from an accepted remote configuration stops that profiler. If you omit a setting from a profiler section, the agent uses its default value. If the remote payload does not contain the distribution.splunk.profiling node, the agent skips profiler-related remote configuration processing.
The selection_probability value must be greater than 0 and no greater than 1. After the agent accepts a remote configuration, that configuration takes precedence over startup configuration for the profiling settings it contains.
Remote configuration for AlwaysOn Profiling for Node.js agent
Configure OpAMP remote configuration for the Node.js agent with environment variables or file-based settings, and review sample profiling payloads.
Using environment variables
You can enable OpAMP remote configuration for the Node.js agent with the following environment variables:
| Environment variable | Description | Default | Required | Type |
|---|---|---|---|---|
SPLUNK_OPAMP_ENABLED |
Set to true to connect to an OpAMP server. |
false |
Yes | boolean |
SPLUNK_OPAMP_ENDPOINT |
The URL of the OpAMP server that you want to connect to. | - | Yes | string |
SPLUNK_OPAMP_REMOTE_CONFIG |
Set to true to enable remote configuration features. |
false | Yes | boolean |
SPLUNK_OPAMP_POLLING_INTERVAL |
Number of milliseconds between agent-to-server polls. | 30000 |
Optional | int |
If required, configure the initial profiling settings of the agent by using the environment variables or system properties. See Node.js settings for AlwaysOn Profiling.
Using file-based configuration
Docs URL:
You can enable OpAMP remote configuration in the agent’s declarative configuration file. Set OTEL_CONFIG_FILE to the path of that file:
OTEL_CONFIG_FILE=/path/to/agent-config.yaml
Add the following configuration to the startup YAML file:
distribution:
splunk:
opamp/development:
endpoint: <URL of the OpAMP server>
polling_interval: 30000
features:
remote_config:
Configure the agent’s initial profiling settings in the startup YAML. See File-based configuration for Node.js in Splunk Observability Cloud.
Sample payload
After you enable OpAMP remote configuration, the OpAMP server sends profiling settings to the agent. The remote payload uses the splunk.remote.config key and application/yaml content type. This is a server-sent payload, separate from the agent’s environment variables and system properties. For more information, see Open Agent Management Protocol specification.
For example, this payload enables CPU profiling with a sampling interval of 1001 milliseconds and memory profiling:
distribution:
splunk:
profiling:
always_on:
cpu_profiler:
sampling_interval: 1001
memory_profiler:
This payload enables snapshot profiling:
distribution:
splunk:
profiling:
callgraphs:
sampling_interval: 10
selection_probability: 0.01
Including cpu_profiler, memory_profiler, or callgraphs enables the corresponding profiler. Omitting one of these sections from an accepted remote configuration stops that profiler. If you omit a setting from a profiler section, the agent uses its default value. If the remote payload does not contain the distribution.splunk.profiling node, the agent skips profiler-related remote configuration processing.
The selection_probability value must be greater than 0 and no greater than 1. After the agent accepts a remote configuration, that configuration takes precedence over startup configuration for the profiling settings it contains.
Supported languages, variables, and permissions
View the supported languages, variables, and permissions for remote configuration of Alwayson Profiling
Supported languages
The following languages support remote configuration for AlwaysOn Profiling
| Language | Available instrumentation |
|---|---|
| Java | Splunk Distribution of OpenTelemetry Java version 2.32.0 or higher |
| Node.js | Splunk Distribution of OpenTelemetry JS version 4.10.0 or higher |
Supported variables for remote configuration for AlwaysOn Profiling
The following settings support remote configuration for AlwaysOn Profiling:
| Environment variable | Description | Default | Type |
|---|---|---|---|
SPLUNK_PROFILER_ENABLED |
Enables the CPU profiler. | false | boolean |
SPLUNK_PROFILER_MEMORY_ENABLED |
Enables the allocation profiler. | false | boolean |
SPLUNK_PROFILER_CALL_STACK_INTERVAL |
How often to sample call stacks. | 10000ms | string |
Permissions
The following role-based permissions apply to users:
| Role | Capabilities | Actions |
|---|---|---|
| Admin | READ_APM_PROFILING_DATA, READ_ENTITY, UPDATE_CONFIG |
View profiling data; start, edit, or stop profiling. |
| Power | READ_APM_PROFILING_DATA, READ_ENTITY |
View profiling data and policy settings, but cannot change them. |
| Usage | READ_APM_PROFILING_DATA, READ_ENTITY |
View profiling data. |
| Read-only | READ_APM_PROFILING_DATA, READ_ENTITY |
View profiling data. |
Enable remote configuration of AlwaysOn Profiling through API
Use APM Profiling Policy API to enable remote configuration of AlwaysOn Profiling
For information about the OpenAPI specifications, see APM Profiling Policy API.
Enable remote configuration of AlwaysOn Profiling through through UI
Use the Splunk Observability Cloud UI to enable AlwaysOn Profiling dynamic remote configuration for a service.
To access and enable AlwaysOn Profiling dynamic remote configuration:
Profiling settings
Review profiling field descriptions and learn how to manage profiling operations and configure multiple environments.
The table provides details about the fields that you need to set:
| Field | Description and behavior |
|---|---|
| Environment | Select the deployment environment, such as production, staging, or development. Each environment has an independent configuration card. |
| Instances | Select the profiling target scope. You can select All instances or one or more specific service instances. The list displays only remotely managed and OpAMP-eligible instances. |
| Code profiling | Enables CPU or code profiling. It collects call-stack data that helps identify slow or inefficient code paths. The sampling interval field is associated with this option. |
| Code & Memory profiling | Enables memory-allocation profiling. It helps identify memory leaks, unusual allocation behavior, and garbage-collection pressure. |
| Sampling interval | Specifies how frequently call stacks are sampled, in milliseconds. The default value is 10,000 ms and requires a positive whole number. Check valid values against agent capability metadata. Lower intervals provide more frequent samples but can increase overhead. |
| Duration | Controls how long the profiling policy remains active. The default value is 10 minutes. |
Manage profiling operations
-
Select Start profiling to submit the configuration and create or update the profiling policy. After submission, the page displays the active policy state, target information, configured settings, remaining time or expiry, and actions such as edit or stop profiling data.
-
Select Edit to reopen the active policy and change the instances, profiling mode, sampling interval, or duration. You can't change the environment.
-
Select Stop profiling to cancel the profiling settings.
Add multiple environments
Select +Add environment to add and configure multiple environments independently in the same workflow.
View profiling data
Use the Code profiling and Memory profiling tabs to view profiling details for a service and environment.
Select the Code profiling and Memory profiling tabs to view the relevant code profiling and memory profiling details with service and environment context.