Replace declarative config bridge usages in contrib#2988
Merged
jaydeluca merged 11 commits intoJul 24, 2026
Merged
Conversation
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
github-actions
Bot
requested review from
JonasKunz,
LikeTheSalad,
SylvainJuge and
jackshirazi
July 13, 2026 13:00
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
zeitlinger
force-pushed
the
agent/replace-declarative-config-properties-bridge-usages
branch
from
July 13, 2026 15:07
09e9e74 to
7958c72
Compare
zeitlinger
force-pushed
the
agent/replace-declarative-config-properties-bridge-usages
branch
from
July 13, 2026 15:23
7958c72 to
3b81d9c
Compare
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
zeitlinger
force-pushed
the
agent/replace-declarative-config-properties-bridge-usages
branch
from
July 13, 2026 15:46
3b81d9c to
e3fefc2
Compare
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
…rumentation-bom-alpha to v2.30.0-alpha
1 task
…arative-config-properties-bridge-usages
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Migrates remaining contrib usages off DeclarativeConfigPropertiesBridgeBuilder in span-stacktrace and inferred-spans, updating both modules to consume component-scoped DeclarativeConfigProperties (underscore keys) and using the newer bridge helpers for accessing ConfigProperties via a component access path.
Changes:
- Switch
span-stacktraceandinferred-spanscomponent providers/autoconfig to use component-scopedDeclarativeConfigPropertiesrather than building aConfigPropertiesbridge mapping. - Replace duration parsing with
DeclarativeConfigDurationUtil.getDuration(...)to align declarative YAML duration behavior (integer millis) with the shared bridge utilities. - Add/adjust tests to validate declarative mapping coverage and update dependency management to the newer instrumentation alpha.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| span-stacktrace/src/test/java/io/opentelemetry/contrib/stacktrace/StackTraceAutoConfigTest.java | Updates tests to validate behavior through the new component-scoped declarative config path. |
| span-stacktrace/src/main/java/io/opentelemetry/contrib/stacktrace/StackTraceComponentProvider.java | Removes bridge builder mapping and delegates directly to StackTraceAutoConfig with declarative properties. |
| span-stacktrace/src/main/java/io/opentelemetry/contrib/stacktrace/StackTraceAutoConfig.java | Introduces component-scoped declarative properties for autoconfig and uses bridge duration util for min_duration. |
| inferred-spans/src/test/java/io/opentelemetry/contrib/inferredspans/internal/SamplingProfilerTest.java | Adjusts timing sleeps (note: appears unrelated to stated PR scope). |
| inferred-spans/src/test/java/io/opentelemetry/contrib/inferredspans/InferredSpansSpanProcessorProviderTest.java | Adds a comprehensive declarative YAML-to-config mapping coverage test (disabled on Windows). |
| inferred-spans/src/test/java/io/opentelemetry/contrib/inferredspans/InferredSpansConfigTest.java | New test validating ConfigProperties → component declarative properties mapping (disabled on Windows). |
| inferred-spans/src/test/java/io/opentelemetry/contrib/inferredspans/InferredSpansAutoConfigTest.java | Updates autoconfig test inputs to use full otel.inferred.spans.* keys now that internals use component-scoped keys. |
| inferred-spans/src/main/java/io/opentelemetry/contrib/inferredspans/InferredSpansSpanProcessorProvider.java | Removes bridge builder mapping and uses InferredSpansConfig directly with declarative properties. |
| inferred-spans/src/main/java/io/opentelemetry/contrib/inferredspans/InferredSpansConfig.java | Refactors config application to read underscore keys from DeclarativeConfigProperties and uses duration util. |
| inferred-spans/src/main/java/io/opentelemetry/contrib/inferredspans/InferredSpansAutoConfig.java | Uses component-scoped declarative properties in autoconfig gating and processor creation. |
| inferred-spans/build.gradle.kts | Ensures the declarative-config bridge dependency is present for tests. |
| dynamic-control/src/main/java/io/opentelemetry/contrib/dynamic/TelemetryPolicySamplerComponentProvider.java | Adds a targeted deprecation suppression for an upcoming migration. |
| dependencyManagement/build.gradle.kts | Bumps opentelemetry-java-instrumentation alpha version to pick up the new bridge helpers. |
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
breedx-splk
approved these changes
Jul 23, 2026
breedx-splk
left a comment
Contributor
There was a problem hiding this comment.
Thanks for picking this up, @zeitlinger.
jaydeluca
approved these changes
Jul 24, 2026
zeitlinger
deleted the
agent/replace-declarative-config-properties-bridge-usages
branch
July 24, 2026 16:06
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
DeclarativeConfigPropertiesBridgeBuilderusages inspan-stacktraceandinferred-spansConfigPropertiesBackedConfigProvideraccess-path APIinferred-spanson flat underscore keysDeclarativeConfigPropertiesDurationUtil.parseDuration(...)Why
DeclarativeConfigPropertiesBridgeis being deprecated inopentelemetry-java-instrumentation, and these remaining contrib usages need to move off it first.This change depends on open-telemetry/opentelemetry-java-instrumentation#19220, which supersedes #15835 and adds the bridge helpers used here.
Related deprecation PR: open-telemetry/opentelemetry-java-instrumentation#19202
The unrelated
SamplingProfilerTestflake fix was split into #3000.How this uses the new bridge APIs
inferred-spansbridges the component root directly tootel.inferred.spans.withConfigPropertiesBackedConfigProvider.builder().setAccessPath("", "otel.inferred.spans.")span-stacktracebridges the component root directly tootel.java.experimental.span-stacktrace.the same wayDeclarativeConfigPropertiesDurationUtil.parseDuration(...)instead of carrying their own parsing copyBreaking behavior change
Declarative config YAML now only accepts integer millisecond values for these duration properties.
Examples:
min_duration: 100min_duration: 100msThat matches the behavior documented on
DeclarativeConfigPropertiesDurationUtil: flatConfigPropertiesinputs can still use string durations such as42ms, but non-ConfigPropertiesdeclarative config only accepts integer milliseconds.Testing
GRADLE_USER_HOME=/tmp/gradle-home-otel-java-contrib ./gradlew --no-build-cache --no-configuration-cache -PuseLocalMaven :span-stacktrace:check :inferred-spans:checkCI note
The newly added
InferredSpansConfigTestcreates a realInferredSpansProcessor, which loads async-profiler. Async-profiler is not supported on Windows, so the test is disabled there with the same@DisabledOnOs(WINDOWS)guard used by the other inferred-spans tests that instantiate it. Earlier CI failures across all platforms masked this Windows-only failure until the dependency and deprecation-warning issues were fixed.Additional verification:
GRADLE_USER_HOME=/tmp/gradle-home-otel-java-contrib-pr2988 ./gradlew --no-build-cache --no-configuration-cache :inferred-spans:check