Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
bf44697
Snapshot Profiler Configuration refactoring
robsunday Jul 7, 2026
5c93e2b
Fix for missing nodes in profiler exporter config
robsunday Jul 7, 2026
efcacf6
Fix for missing nodes in profiler exporter config
robsunday Jul 7, 2026
eff6544
Code review followup
robsunday Jul 8, 2026
b8e36cf
Merge branch 'main' into opamp-snapshot-profiler-config-refactor
robsunday Jul 10, 2026
57276b0
Merge branch 'main' into opamp-snapshot-profiler-config-refactor
robsunday Jul 14, 2026
898d25e
Initial commit
robsunday Jul 14, 2026
73b5c6d
Test fixes and cleanup of comments
robsunday Jul 15, 2026
dbdaeaa
Merge branch 'main' into opamp-call-graphs
robsunday Jul 15, 2026
576149f
Tests cleanup
robsunday Jul 15, 2026
6f66ce4
SpanTracker support
robsunday Jul 15, 2026
cce4a7d
Merge branch 'main' into opamp-call-graphs
robsunday Jul 17, 2026
656daea
TraceThreadChangeDetector support
robsunday Jul 17, 2026
900e1f8
Tests updated after TraceThreadChangeDetector support
robsunday Jul 17, 2026
a7aa8c6
Tests improved
robsunday Jul 17, 2026
0538bb5
Declarative config customizer improvements
robsunday Jul 17, 2026
b23d3d1
SnapshotProfilingSpanProcessor support
robsunday Jul 20, 2026
e39a53f
spotless
robsunday Jul 20, 2026
a1c515e
Merge branch 'main' into opamp-call-graphs
robsunday Jul 21, 2026
9263e54
Remote config support
robsunday Jul 21, 2026
d8bd09c
Merge branch 'main' into opamp-call-graphs
robsunday Jul 22, 2026
c49b821
Merge branch 'opamp-call-graphs' into opamp-call-graphs-remote-config
robsunday Jul 22, 2026
8325285
Spotless
robsunday Jul 22, 2026
61c573c
SnapshotProfilingSupervisor improvement
robsunday Jul 23, 2026
c084413
code review followup
robsunday Jul 24, 2026
c603258
Merge branch 'main' into opamp-call-graphs
robsunday Jul 24, 2026
4ac828d
code review followup
robsunday Jul 24, 2026
0cac85b
Merge branch 'main' into opamp-call-graphs
robsunday Jul 24, 2026
688b329
Merge branch 'opamp-call-graphs' into opamp-call-graphs-remote-config
robsunday Jul 24, 2026
353e147
Merge branch 'main' into opamp-call-graphs-remote-config
robsunday Jul 24, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import com.splunk.opentelemetry.profiler.ProfilingDataType;
import com.splunk.opentelemetry.profiler.ProfilingSupervisor;
import com.splunk.opentelemetry.profiler.exporter.PprofLogDataExporter;
import com.splunk.opentelemetry.profiler.snapshot.SnapshotProfilingSupervisor;
import io.opentelemetry.javaagent.extension.AgentListener;
import io.opentelemetry.opamp.client.OpampClient;
import io.opentelemetry.opamp.client.OpampClientBuilder;
Expand Down Expand Up @@ -74,7 +75,10 @@ public void afterAgent(AutoConfiguredOpenTelemetrySdk autoConfiguredOpenTelemetr
buildCommandDispatcher(autoConfiguredOpenTelemetrySdk, opampClientConfiguration);
ServerToAgentMessageHandler serverToAgentMessageHandler =
new ServerToAgentMessageHandler(
ProfilingSupervisor.SUPPLIER.get(), effectiveConfigReporter, commandDispatcher);
ProfilingSupervisor.SUPPLIER.get(),
SnapshotProfilingSupervisor.SUPPLIER.get(),
effectiveConfigReporter,
commandDispatcher);

OpampClient client =
startOpampClient(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
import com.splunk.opentelemetry.profiler.ProfilerConfiguration;
import com.splunk.opentelemetry.profiler.ProfilerDeclarativeConfigurationFactory;
import com.splunk.opentelemetry.profiler.ProfilingSupervisor;
import com.splunk.opentelemetry.profiler.snapshot.SnapshotProfilingConfiguration;
import com.splunk.opentelemetry.profiler.snapshot.SnapshotProfilingDeclarativeConfigurationFactory;
import com.splunk.opentelemetry.profiler.snapshot.SnapshotProfilingSupervisor;
import io.opentelemetry.api.incubator.config.DeclarativeConfigProperties;
import io.opentelemetry.opamp.client.OpampClient;
import io.opentelemetry.sdk.autoconfigure.declarativeconfig.DeclarativeConfiguration;
Expand All @@ -44,11 +47,15 @@ public class RemoteConfigProcessor {
private static final String PROFILING_NODE_NAME = "profiling";

private final ProfilingSupervisor profilingSupervisor;
private final SnapshotProfilingSupervisor snapshotProfilingSupervisor;
private final EffectiveConfigReporter effectiveConfigReporter;

public RemoteConfigProcessor(
ProfilingSupervisor profilingSupervisor, EffectiveConfigReporter effectiveConfigReporter) {
ProfilingSupervisor profilingSupervisor,
SnapshotProfilingSupervisor snapshotProfilingSupervisor,
EffectiveConfigReporter effectiveConfigReporter) {
this.profilingSupervisor = Objects.requireNonNull(profilingSupervisor);
this.snapshotProfilingSupervisor = Objects.requireNonNull(snapshotProfilingSupervisor);
this.effectiveConfigReporter = Objects.requireNonNull(effectiveConfigReporter);
}

Expand Down Expand Up @@ -76,22 +83,8 @@ public void applyConfig(AgentRemoteConfig remoteConfig, OpampClient opampClient)

// Update profiler configuration only when profiling node exists
if (distributionRemoteConfigProperties.getPropertyKeys().contains(PROFILING_NODE_NAME)) {
ProfilerConfiguration receivedProfilerConfig =
ProfilerDeclarativeConfigurationFactory.create(
distributionRemoteConfigProperties.getStructured(PROFILING_NODE_NAME, empty()));

ProfilerConfiguration currentProfilerConfiguration = ProfilerConfiguration.SUPPLIER.get();
ProfilerConfiguration updatedProfilerConfig =
currentProfilerConfiguration.toBuilder()
.setEnabled(receivedProfilerConfig.isEnabled())
.setCallStackInterval(receivedProfilerConfig.getCallStackInterval())
.setMemoryEnabled(receivedProfilerConfig.getMemoryEnabled())
.build();

if (!currentProfilerConfiguration.equals(updatedProfilerConfig)) {
ProfilerConfiguration.SUPPLIER.configure(updatedProfilerConfig);
profilingSupervisor.requestReinitializeProfiling();
}
applyAlwaysOnProfilingConfiguration(distributionRemoteConfigProperties);
applySnapshotProfilingConfiguration(distributionRemoteConfigProperties);
}

// Confirm to the OpAMP Server that remote config has been applied.
Expand All @@ -114,6 +107,43 @@ public void applyConfig(AgentRemoteConfig remoteConfig, OpampClient opampClient)
effectiveConfigReporter.reportEffectiveConfigIfChanged();
}

private void applyAlwaysOnProfilingConfiguration(
DeclarativeConfigProperties distributionRemoteConfigProperties) {
ProfilerConfiguration receivedConfiguration =
ProfilerDeclarativeConfigurationFactory.create(
distributionRemoteConfigProperties.getStructured(PROFILING_NODE_NAME, empty()));

ProfilerConfiguration currentConfiguration = ProfilerConfiguration.SUPPLIER.get();
ProfilerConfiguration updatedConfiguration =
currentConfiguration.toBuilder()
.setEnabled(receivedConfiguration.isEnabled())
.setCallStackInterval(receivedConfiguration.getCallStackInterval())
.setMemoryEnabled(receivedConfiguration.getMemoryEnabled())
.build();

if (!currentConfiguration.equals(updatedConfiguration)) {
ProfilerConfiguration.SUPPLIER.configure(updatedConfiguration);
profilingSupervisor.requestReinitializeProfiling();
}
}

private void applySnapshotProfilingConfiguration(
DeclarativeConfigProperties distributionRemoteConfigProperties) {
SnapshotProfilingConfiguration receivedConfiguration =
SnapshotProfilingDeclarativeConfigurationFactory.create(
distributionRemoteConfigProperties.getStructured(PROFILING_NODE_NAME, empty()));

SnapshotProfilingConfiguration currentConfiguration =
SnapshotProfilingConfiguration.SUPPLIER.get();
SnapshotProfilingConfiguration updatedConfiguration =
currentConfiguration.toBuilder().setEnabled(receivedConfiguration.isEnabled()).build();

if (!currentConfiguration.equals(updatedConfiguration)) {
SnapshotProfilingConfiguration.SUPPLIER.configure(updatedConfiguration);
snapshotProfilingSupervisor.reinitializeProfiling();
}
}

@VisibleForTesting
static DeclarativeConfigProperties toDeclarativeConfigProperties(AgentConfigFile configFile) {
return DeclarativeConfiguration.toConfigProperties(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import com.splunk.opamp.remotecontrol.CommandDispatcher;
import com.splunk.opentelemetry.opamp.effectiveconfig.EffectiveConfigReporter;
import com.splunk.opentelemetry.profiler.ProfilingSupervisor;
import com.splunk.opentelemetry.profiler.snapshot.SnapshotProfilingSupervisor;
import io.opentelemetry.opamp.client.OpampClient;
import io.opentelemetry.opamp.client.internal.response.MessageData;
import opamp.proto.AgentConfigFile;
Expand All @@ -34,10 +35,13 @@ public class ServerToAgentMessageHandler {

public ServerToAgentMessageHandler(
ProfilingSupervisor profilingSupervisor,
SnapshotProfilingSupervisor snapshotProfilingSupervisor,
EffectiveConfigReporter effectiveConfigReporter,
CommandDispatcher commandDispatcher) {
this(
new RemoteConfigProcessor(profilingSupervisor, effectiveConfigReporter), commandDispatcher);
new RemoteConfigProcessor(
profilingSupervisor, snapshotProfilingSupervisor, effectiveConfigReporter),
commandDispatcher);
}

@VisibleForTesting
Expand Down
Loading
Loading