Skip to content

declarative config: early init and property mapping #14184

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 77 commits into
base: main
Choose a base branch
from

Conversation

zeitlinger
Copy link
Member

@zeitlinger zeitlinger commented Jul 4, 2025

Fixes #14133
Fixes #14132
Fixes #14160

Integration test already existed before:

testing {
suites {
val declarativeConfigTest by registering(JvmTestSuite::class) {
targets {
all {
testTask.configure {
jvmArgs(
"-Dotel.experimental.config.file=$projectDir/src/declarativeConfigTest/resources/declarative-config.yaml"
)
}
}
}
}
}
}

@zeitlinger zeitlinger requested a review from a team as a code owner July 4, 2025 16:56
@zeitlinger zeitlinger marked this pull request as draft July 4, 2025 16:56
@zeitlinger zeitlinger self-assigned this Jul 4, 2025
@zeitlinger zeitlinger marked this pull request as ready for review July 7, 2025 08:14
@zeitlinger
Copy link
Member Author

zeitlinger commented Jul 7, 2025

@laurit @trask please have a look 😄

I will create a bunch of follow up tasks to not make this PR bigger.

@zeitlinger zeitlinger force-pushed the declarative-config-underscore branch from ea7fdfd to a36770e Compare July 7, 2025 11:37
@zeitlinger
Copy link
Member Author

We may need to rearrange the code to install the early instrumentations before configuration is available to ensure that we can transform the classes before they are loaded.

This still leaves "otel.javaagent.enabled" - which promises not to touch anything if the value is false.

@zeitlinger
Copy link
Member Author

The problem with logging is that currently it should be configured before anything is logged

https://github.com/open-telemetry/opentelemetry-java/blob/main/sdk-extensions/incubator/src/main/java/io/opentelemetry/sdk/extension/incubator/fileconfig/DeclarativeConfiguration.java doesn't log for the method that we call - but jackson can throw exceptions (which I can buffer like ConfigurationFile)

@zeitlinger
Copy link
Member Author

Reading the declarative config is going to pull in a bunch of classes which could load the classes we wish to transform

How can we find out if that's the case? E.g. a tool to compare loaded classes against what we want to transform.

@zeitlinger
Copy link
Member Author

@zeitlinger
Copy link
Member Author

@laurit please have a look 😄

@zeitlinger zeitlinger force-pushed the declarative-config-underscore branch from 1e27b90 to 548e56c Compare July 16, 2025 11:37
@otelbot-java-instrumentation
Copy link
Contributor

🔧 The result from spotlessApply was committed to the PR branch.

@github-actions github-actions bot added the test native This label can be applied to PRs to trigger them to run native tests label Jul 17, 2025
@zeitlinger zeitlinger force-pushed the declarative-config-underscore branch from 811b037 to b0c18d3 Compare July 18, 2025 12:48
@zeitlinger
Copy link
Member Author

@laurit please check again

@zeitlinger zeitlinger force-pushed the declarative-config-underscore branch from a8aeebf to 413ec6d Compare August 13, 2025 11:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test native This label can be applied to PRs to trigger them to run native tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve InstrumentationConfig for declarative config declarative configuration: - vs _ in mapped properties declarative config: property mapping
4 participants