-
Notifications
You must be signed in to change notification settings - Fork 324
Refactor config into its own module #9426
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 |
|---|---|---|
|
|
@@ -77,6 +77,8 @@ | |
| import static datadog.trace.util.CollectionUtils.tryMakeImmutableSet; | ||
|
|
||
| import datadog.trace.api.profiling.ProfilingEnablement; | ||
| import datadog.trace.api.telemetry.OtelEnvMetricCollectorImpl; | ||
| import datadog.trace.api.telemetry.OtelEnvMetricCollectorProvider; | ||
| import datadog.trace.bootstrap.config.provider.ConfigProvider; | ||
| import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; | ||
| import java.lang.reflect.Method; | ||
|
|
@@ -172,6 +174,11 @@ public class InstrumenterConfig { | |
|
|
||
| private final boolean rumEnabled; | ||
|
|
||
| static { | ||
| // Bind telemetry collector to config module before initializing ConfigProvider | ||
| OtelEnvMetricCollectorProvider.register(OtelEnvMetricCollectorImpl.getInstance()); | ||
| } | ||
|
Comment on lines
+177
to
+180
Contributor
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. question: For my understanding this registration code is called here and in Config class, why is that ?
Contributor
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. The two modules are tightly coupled together. |
||
|
|
||
| private InstrumenterConfig() { | ||
| this(ConfigProvider.createDefault()); | ||
| } | ||
|
|
||
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.
For my understanding, is there a reason that you chose to register the instance here instead of when it is initialized in
OtelEnvMetricCollectorImpl?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.
There is nobody to initialize it. The code that needs it can't have a dependency on it (to avoid circular dependency).
So the initialization should come from the
:internal-apimodule.