Skip to content

Replace declarative config bridge usages in contrib#2988

Draft
zeitlinger wants to merge 5 commits into
open-telemetry:mainfrom
zeitlinger:agent/replace-declarative-config-properties-bridge-usages
Draft

Replace declarative config bridge usages in contrib#2988
zeitlinger wants to merge 5 commits into
open-telemetry:mainfrom
zeitlinger:agent/replace-declarative-config-properties-bridge-usages

Conversation

@zeitlinger

@zeitlinger zeitlinger commented Jul 13, 2026

Copy link
Copy Markdown
Member

Blocked by open-telemetry/opentelemetry-java-instrumentation#19220

Summary

  • replace the remaining contrib DeclarativeConfigPropertiesBridgeBuilder usages in span-stacktrace and inferred-spans
  • switch those modules to the new ConfigPropertiesBackedConfigProvider access-path API
  • keep the declarative config access in inferred-spans on flat underscore keys
  • remove duplicated duration parsing by using DeclarativeConfigPropertiesDurationUtil.parseDuration(...)

Why

DeclarativeConfigPropertiesBridge is being deprecated in opentelemetry-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 SamplingProfilerTest flake fix was split into #3000.

How this uses the new bridge APIs

  • inferred-spans bridges the component root directly to otel.inferred.spans. with ConfigPropertiesBackedConfigProvider.builder().setAccessPath("", "otel.inferred.spans.")
  • span-stacktrace bridges the component root directly to otel.java.experimental.span-stacktrace. the same way
  • both modules use DeclarativeConfigPropertiesDurationUtil.parseDuration(...) instead of carrying their own parsing copy

Breaking behavior change

Declarative config YAML now only accepts integer millisecond values for these duration properties.

Examples:

  • supported: min_duration: 100
  • not supported in declarative YAML anymore: min_duration: 100ms

That matches the behavior documented on DeclarativeConfigPropertiesDurationUtil: flat ConfigProperties inputs can still use string durations such as 42ms, but non-ConfigProperties declarative 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:check

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>
@zeitlinger
zeitlinger force-pushed the agent/replace-declarative-config-properties-bridge-usages branch from 3b81d9c to e3fefc2 Compare July 13, 2026 15:46
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant