-
Notifications
You must be signed in to change notification settings - Fork 1k
Update DeclarativeConfigUtil to support general node #15704
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,7 +22,7 @@ public final class ExperimentalConfig { | |
| private static final ExperimentalConfig instance = | ||
| new ExperimentalConfig(GlobalOpenTelemetry.get()); | ||
|
|
||
| private final ExtendedDeclarativeConfigProperties config; | ||
| private final ExtendedDeclarativeConfigProperties commonConfig; | ||
| private final List<String> messagingHeaders; | ||
|
|
||
| /** Returns the global agent configuration. */ | ||
|
|
@@ -31,35 +31,28 @@ public static ExperimentalConfig get() { | |
| } | ||
|
|
||
| public ExperimentalConfig(OpenTelemetry openTelemetry) { | ||
| this.config = DeclarativeConfigUtil.get(openTelemetry); | ||
| this.commonConfig = DeclarativeConfigUtil.getInstrumentationConfig(openTelemetry, "common"); | ||
| this.messagingHeaders = | ||
| config | ||
| commonConfig | ||
| .get("messaging") | ||
|
Comment on lines
+36
to
37
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Moved the common |
||
| .getScalarList("capture_headers/development", String.class, emptyList()); | ||
| } | ||
|
|
||
| public boolean controllerTelemetryEnabled() { | ||
| return config | ||
| .get("common") | ||
| .get("controller_telemetry/development") | ||
| .getBoolean("enabled", false); | ||
| return commonConfig.get("controller_telemetry/development").getBoolean("enabled", false); | ||
| } | ||
|
|
||
| public boolean viewTelemetryEnabled() { | ||
| return config.get("common").get("view_telemetry/development").getBoolean("enabled", false); | ||
| return commonConfig.get("view_telemetry/development").getBoolean("enabled", false); | ||
| } | ||
|
|
||
| public boolean messagingReceiveInstrumentationEnabled() { | ||
| return config | ||
| return commonConfig | ||
| .get("messaging") | ||
|
Comment on lines
+50
to
51
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same here |
||
| .get("receive_telemetry/development") | ||
| .getBoolean("enabled", false); | ||
| } | ||
|
|
||
| public boolean indyEnabled() { | ||
| return config.get("agent").getBoolean("indy/development", false); | ||
| } | ||
|
|
||
|
Comment on lines
-59
to
-62
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. removed this from ExperimentalConfig because it really belongs in some kind of "distribution config" which deserves a different abstraction, related to open-telemetry/opentelemetry-specification#4800 (comment) |
||
| public List<String> getMessagingHeaders() { | ||
| return messagingHeaders; | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,7 +9,7 @@ | |
| import static java.util.Collections.unmodifiableSet; | ||
| import static net.bytebuddy.matcher.ElementMatchers.any; | ||
|
|
||
| import io.opentelemetry.javaagent.bootstrap.internal.ExperimentalConfig; | ||
| import io.opentelemetry.javaagent.bootstrap.internal.AgentInstrumentationConfig; | ||
| import io.opentelemetry.sdk.autoconfigure.spi.ConfigProperties; | ||
| import io.opentelemetry.sdk.autoconfigure.spi.Ordered; | ||
| import java.util.Collections; | ||
|
|
@@ -161,7 +161,8 @@ private static class IndyConfigurationHolder { | |
| private static final boolean indyEnabled; | ||
|
|
||
| static { | ||
| indyEnabled = ExperimentalConfig.get().indyEnabled(); | ||
| indyEnabled = | ||
| AgentInstrumentationConfig.get().getBoolean("otel.javaagent.experimental.indy", false); | ||
|
Comment on lines
+164
to
+165
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. will come back to this an create some kind of "distribution config" abstraction not saying we should, but even if we decide to keep it under |
||
| if (indyEnabled) { | ||
| logger.info("Enabled indy for instrumentation modules"); | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
currently proposed naming from open-telemetry/opentelemetry-java#7927