open-telemetry / open-telemetry/opentelemetry-java-contrib
Discuss migrating dynamic-control from ConfigProperties to DeclarativeConfigProperties
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 269
- Forks
- 196
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 38
Description
Summary
dynamic-control still uses ConfigProperties internally in a few places, and a follow-up idea was to replace those usages with DeclarativeConfigProperties.
That needs design discussion first.
Why discuss first
A key concern is that the current TelemetryPolicySamplerComponentProvider path uses SystemPropertyFallbackConfigProperties, which manually reads from system properties / env vars.
That is important because it violates the spirit of dynamic-control's declarative config path: when dynamic-control is configured through declarative config, we should be very clear whether it is supposed to honor only the declarative config model, or whether it is also allowed to reach out to unrelated system properties / env vars on its own.
A naive migration away from ConfigProperties risks either:
- preserving behavior that we may not actually want to preserve, or
- accidentally changing behavior without first agreeing what the intended behavior should be.
So before changing dynamic-control to use DeclarativeConfigProperties throughout, we should clarify:
- whether
dynamic-controlshould manually read system properties / env vars at all in declarative-config mode - which config in
dynamic-controlis intentionally declarative-only - whether any fallback semantics are intentional, accidental, or need to be split by use case
- what the desired API shape is for sources/providers such as
OpampPolicyProvider
Scope candidates
Potential follow-up work after agreement:
TelemetryPolicySamplerComponentProviderPolicyInitSourceKindOpampPolicyProvider- related tests
Context
This came up while reducing deprecated DeclarativeConfigPropertiesBridgeBuilder usage in:
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Review PR 2988 and inspect the listed entry points: TelemetryPolicySamplerComponentProvider, PolicyInit, SourceKind, and OpampPolicyProvider, along with their related tests. The discussion is done when the intended system-property and environment-variable fallback semantics, declarative-only configuration boundaries, and provider API shape are agreed and the follow-up work is clearly scoped.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- observability
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 32/100