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

  • Policy Provider -> Aggregator -> Policy Implementer

An example could be

  • OpAMP policy provider (reads from OpAMP) -> JSON* patch Aggregator (merges JSON for different policy types) -> Trace sampling rate Implementer (takes a new traceid rate and applies it to the sampler)

* Note JSON is the proposal in the document, and not simply an arbitrary choice for this example

Overall, the current proposal suggests these elements

FileProvider -----\
HTTPProvider ----- \  
OpAMPProvider ----- > PolicyAggregator --> PolicyStore --> 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
  • PolicyAggregator to merge TelemetryPolicys - for flat files this is overkill but for structured files, the result is needed
  • 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 a flat 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. A full working implementation is here in this branch.

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