Skip to content
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

Fix disabling micrometer #1478

Merged
merged 1 commit into from
Feb 9, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
import com.microsoft.applicationinsights.web.internal.correlation.CdsProfileFetcher;
import io.opentelemetry.instrumentation.api.aiconnectionstring.AiConnectionString;
import io.opentelemetry.instrumentation.api.config.Config;
import io.opentelemetry.instrumentation.api.config.ConfigBuilder;
import org.apache.http.HttpHost;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.slf4j.Logger;
Expand Down Expand Up @@ -125,6 +126,7 @@ private static void start(Instrumentation instrumentation) throws Exception {
// TODO need some kind of test for these configuration properties
if (!isInstrumentationEnabled(config, "micrometer")) {
properties.put("otel.instrumentation.micrometer.enabled", "false");
trask marked this conversation as resolved.
Show resolved Hide resolved
properties.put("otel.instrumentation.actuator-metrics.enabled", "false");
}
if (!isInstrumentationEnabled(config, "jdbc")) {
properties.put("otel.instrumentation.jdbc.enabled", "false");
Expand All @@ -149,7 +151,7 @@ private static void start(Instrumentation instrumentation) throws Exception {
// AI exporter is configured manually
properties.put("otel.trace.exporter", "none");
properties.put("otel.metrics.exporter", "none");
Config.internalInitializeConfig(Config.create(properties));
Config.internalInitializeConfig(new ConfigBuilder().readProperties(properties).build());
if (Config.get().getListProperty("otel.additional.bootstrap.package.prefixes").isEmpty()) {
throw new IllegalStateException("underlying config not initialized in time");
}
Expand Down