Feature Request
Context
The OpAMP runtime-configuration work in #5312 has exposed a broader architectural requirement in the continuous-profiler service.
The service was originally designed around a start-once, seed-once lifecycle. Dynamic configuration introduces additional requirements:
- enabling and disabling profiling features at runtime;
- changing CPU, selective-thread, and allocation-sampling settings atomically;
- preserving process-wide configuration across .NET Framework AppDomain initialization and unload;
- defining precedence between startup Seed and ControlPlane configuration;
- preventing multiple AppDomain-local exporters from competing for process-wide native samples;
- recovering the managed exporter and canary after their owning AppDomain unloads;
- preserving compatibility between different managed and native package versions.
These are process-wide service semantics and should be established independently of the OpAMP transport and managed exporter implementation.
Proposed direction
Define a protocol-neutral native runtime-service contract that provides:
- one-time, source-neutral bootstrap;
- complete atomic runtime-configuration application;
ControlPlane > Seed > None authority precedence;
- last-known-good behavior for invalid or stale updates;
- lazy producer activation and safe quiescence;
- explicit capture, disable, and terminal-shutdown boundaries;
- opaque managed-host ownership tokens;
- AppDomain-unload revocation and demand-driven host recovery;
Managed code would remain responsible for interpreting and merging OpAMP configuration, constructing the exporter pipeline and canary, and invoking this native contract.
Although the proposed contract is comprehensive, much of that complexity already exists in the runtime environment and is currently implicit. This is particularly true on .NET Framework, where process-wide native profiling state must coexist with managed components whose AppDomains can arrive and depart independently. Exporter ownership, AppDomain unload, canary recruitment and invalidation, competing initialization attempts, and recovery after owner loss all require defined semantics. The purpose of this design is to make those lifecycle rules explicit, deterministic, and independently testable before dynamic OpAMP integration depends on them.
Proposed delivery
Split delivery horizontally:
- Implement and test the native runtime-service lifecycle and interop contract.
- Connect the managed OpAMP control plane and exporter pipeline to that contract.
This allows native concurrency, ownership, authority, and lifecycle semantics to be reviewed and tested independently before adding managed protocol integration.
Design draft
The attached document is a working design proposal intended to support discussion and refinement.
dynamic-profiling-service-design-proposal
Decisions requested
- Do the proposed authority, lifecycle, AppDomain ownership, and compatibility semantics provide an appropriate basis for implementation?
- Do we agree with the native/managed responsibility boundary?
- Which parts require discussion or approval in a SIG meeting?
Is this complexity justified?
In my view, yes. Much of the complexity is inherent—particularly in .NET Framework AppDomain arrival, departure, exporter ownership, and canary lifecycle scenarios. This contract makes those semantics explicit and contains them at the native service boundary, allowing the managed OpAMP and exporter integration to remain comparatively simple.
Feature Request
Context
The OpAMP runtime-configuration work in #5312 has exposed a broader architectural requirement in the continuous-profiler service.
The service was originally designed around a start-once, seed-once lifecycle. Dynamic configuration introduces additional requirements:
These are process-wide service semantics and should be established independently of the OpAMP transport and managed exporter implementation.
Proposed direction
Define a protocol-neutral native runtime-service contract that provides:
ControlPlane > Seed > Noneauthority precedence;Managed code would remain responsible for interpreting and merging OpAMP configuration, constructing the exporter pipeline and canary, and invoking this native contract.
Although the proposed contract is comprehensive, much of that complexity already exists in the runtime environment and is currently implicit. This is particularly true on .NET Framework, where process-wide native profiling state must coexist with managed components whose AppDomains can arrive and depart independently. Exporter ownership, AppDomain unload, canary recruitment and invalidation, competing initialization attempts, and recovery after owner loss all require defined semantics. The purpose of this design is to make those lifecycle rules explicit, deterministic, and independently testable before dynamic OpAMP integration depends on them.
Proposed delivery
Split delivery horizontally:
This allows native concurrency, ownership, authority, and lifecycle semantics to be reviewed and tested independently before adding managed protocol integration.
Design draft
The attached document is a working design proposal intended to support discussion and refinement.
dynamic-profiling-service-design-proposal
Decisions requested
Is this complexity justified?
In my view, yes. Much of the complexity is inherent—particularly in .NET Framework AppDomain arrival, departure, exporter ownership, and canary lifecycle scenarios. This contract makes those semantics explicit and contains them at the native service boundary, allowing the managed OpAMP and exporter integration to remain comparatively simple.