open-telemetry / open-telemetry/opentelemetry-java-contrib

Discuss migrating dynamic-control from ConfigProperties to DeclarativeConfigProperties

Open
#2,989 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

instrumentation 3.0
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-control should manually read system properties / env vars at all in declarative-config mode
  • which config in dynamic-control is 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:

  • TelemetryPolicySamplerComponentProvider
  • PolicyInit
  • SourceKind
  • OpampPolicyProvider
  • related tests

Context

This came up while reducing deprecated DeclarativeConfigPropertiesBridgeBuilder usage in:

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.