Skip to content

Commit

Permalink
Merge pull request #44931 from brunobat/otel-log-exporter-level
Browse files Browse the repository at this point in the history
Reduce log level of OTel side exporter classes
  • Loading branch information
geoand authored Dec 5, 2024
2 parents f66bb9e + 0bf88b6 commit 83f4243
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import java.util.List;
import java.util.function.BooleanSupplier;
import java.util.logging.Level;

import jakarta.enterprise.inject.Instance;
import jakarta.inject.Singleton;
Expand All @@ -21,6 +22,7 @@
import io.quarkus.arc.deployment.SyntheticBeanBuildItem;
import io.quarkus.deployment.annotations.*;
import io.quarkus.deployment.annotations.Record;
import io.quarkus.deployment.builditem.LogCategoryBuildItem;
import io.quarkus.deployment.builditem.RunTimeConfigBuilderBuildItem;
import io.quarkus.opentelemetry.runtime.config.build.OTelBuildConfig;
import io.quarkus.opentelemetry.runtime.config.build.exporter.OtlpExporterBuildConfig;
Expand Down Expand Up @@ -75,6 +77,13 @@ public boolean getAsBoolean() {
}
}

@BuildStep
void logging(BuildProducer<LogCategoryBuildItem> log) {
// Reduce the log level of the exporters because it's too much, and we do log important things ourselves.
log.produce(new LogCategoryBuildItem("io.opentelemetry.exporter.internal.grpc.GrpcExporter", Level.OFF));
log.produce(new LogCategoryBuildItem("io.opentelemetry.exporter.internal.http.HttpExporter", Level.OFF));
}

@BuildStep
void config(BuildProducer<RunTimeConfigBuilderBuildItem> runTimeConfigBuilderProducer) {
runTimeConfigBuilderProducer.produce(new RunTimeConfigBuilderBuildItem(OtlpExporterConfigBuilder.class));
Expand Down

0 comments on commit 83f4243

Please sign in to comment.