Skip to content
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 @@ -2,12 +2,12 @@

import static io.quarkus.opentelemetry.runtime.config.build.ExporterType.Constants.CDI_VALUE;

import java.util.logging.Logger;

import jakarta.enterprise.inject.Any;
import jakarta.enterprise.inject.Instance;
import jakarta.enterprise.inject.spi.CDI;

import org.jboss.logging.Logger;

import io.opentelemetry.sdk.autoconfigure.spi.ConfigProperties;
import io.opentelemetry.sdk.autoconfigure.spi.logs.ConfigurableLogRecordExporterProvider;
import io.opentelemetry.sdk.logs.export.LogRecordExporter;
Expand All @@ -20,14 +20,16 @@ public class LogsExporterCDIProvider implements ConfigurableLogRecordExporterPro
@Override
public LogRecordExporter createExporter(ConfigProperties configProperties) {
Instance<LogRecordExporter> exporters = CDI.current().select(LogRecordExporter.class, Any.Literal.INSTANCE);
log.fine("available exporters: " + exporters.stream()
.map(e -> e.getClass().getName())
.reduce((a, b) -> a + ", " + b)
.orElse("none"));
if (log.isDebugEnabled()) {
log.debug("available exporters: " + exporters.stream()
.map(e -> e.getClass().getName())
.reduce((a, b) -> a + ", " + b)
.orElse("none"));
}
if (exporters.isUnsatisfied()) {
return NoopLogRecordExporter.INSTANCE;
} else {
log.fine("using exporter: " + exporters.get().getClass().getName());
log.debugf("using exporter: %s", exporters.get().getClass().getName());
return exporters.get();
}
}
Expand Down
Loading