Search in sources :

Example 16 with SdkLogEmitterProvider

use of io.opentelemetry.sdk.logs.SdkLogEmitterProvider in project opentelemetry-java-instrumentation by open-telemetry.

the class OpenTelemetryAppenderConfigTest method setupAll.

@BeforeAll
static void setupAll() {
    logExporter = InMemoryLogExporter.create();
    resource = Resource.getDefault();
    instrumentationLibraryInfo = InstrumentationLibraryInfo.create("TestLogger", null);
    SdkLogEmitterProvider logEmitterProvider = SdkLogEmitterProvider.builder().setResource(resource).addLogProcessor(SimpleLogProcessor.create(logExporter)).build();
    OpenTelemetryAppender.resetSdkLogEmitterProviderForTest();
    OpenTelemetryAppender.setSdkLogEmitterProvider(logEmitterProvider);
}
Also used : SdkLogEmitterProvider(io.opentelemetry.sdk.logs.SdkLogEmitterProvider) BeforeAll(org.junit.jupiter.api.BeforeAll)

Aggregations

SdkLogEmitterProvider (io.opentelemetry.sdk.logs.SdkLogEmitterProvider)16 Test (org.junit.jupiter.api.Test)10 LogData (io.opentelemetry.sdk.logs.data.LogData)8 CompletableResultCode (io.opentelemetry.sdk.common.CompletableResultCode)4 List (java.util.List)4 TimeUnit (java.util.concurrent.TimeUnit)4 SuppressLogger (io.opentelemetry.internal.testing.slf4j.SuppressLogger)3 OpenTelemetrySdk (io.opentelemetry.sdk.OpenTelemetrySdk)3 SdkMeterProvider (io.opentelemetry.sdk.metrics.SdkMeterProvider)3 SdkTracerProvider (io.opentelemetry.sdk.trace.SdkTracerProvider)3 BeforeEach (org.junit.jupiter.api.BeforeEach)3 Timeout (org.junit.jupiter.api.Timeout)3 ExtendWith (org.junit.jupiter.api.extension.ExtendWith)3 Mock (org.mockito.Mock)3 Mockito.when (org.mockito.Mockito.when)3 GuardedBy (io.opentelemetry.api.internal.GuardedBy)2 ArrayList (java.util.ArrayList)2 Collections (java.util.Collections)2 Map (java.util.Map)2 Assertions.assertThat (org.assertj.core.api.Assertions.assertThat)2