Skip to content

[Dynamic] Add basic Telemetry Policy support to dynamic-control #2546

@jackshirazi

Description

@jackshirazi

Component(s)

dynamic-control

Is your feature request related to a problem? Please describe.

The draft Telemetry Policy seems a reasonable approach to provide a framework for dynamically updating features, so is appropriate to implement here experimentally

The current proposal provides for a process from some source of a change definition through to applying that change in the agent. At a high level, it is

  • message -> provider -> policy -> policy aggregator -> implementer

An example could be

  • message to make a change to the "sampling rate" -> OpampPolicyProvider (reads the message from OpAMP) -> TraceSamplingRatePolicy (the policy that changes the sampling rate, with the target traceid rate) -> PolicyStore (handles priority and potential merges of policy types) -> TraceSamplingRatePolicyImplementer (takes a new traceid rate and applies it to the sampler)

The policy body data structure sent to the provider is non-specific

Overall, the current proposal suggests these elements

FileProvider -----\
HTTPProvider ----- \  
OpAMPProvider ----- > PolicyHandler --> PolicyImplementers
CustomProvider ----/

Describe the solution you'd like

Add in a basic example using the proposed framework, to periodically read from a file and applying it to dynamically changing the sampling rate. Expected additions:

  • TelemetryPolicy
  • PolicyProvider interface for providers common behaviours
  • LinePerPolicyFileProvider to read a file and create TelemetryPolicys
  • PolicyImplementer interface to handle changes to policies, so that the ...
  • PolicyStore handles changes and propagates them to appliers
  • A DelegatingSampler so that changes can be applied generically in the sampler chain
  • A specific TraceSamplingRatePolicyImplementer to apply changes to the sampling rate
  • env var/property/config option to specify an init file
  • A TelemetryPolicyManager which manages the full process
  • extension handling so that this can be used as an extension

To keep things easy for reviews, I'll add things piecewise. The initial implementation is nearing completion, there remain elements to be added to fully setup the policy pipeline described above, and to make the implementation a working extension

Describe alternatives you've considered

No response

Additional context

Part of #2416

Tip

React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions