Search in sources :

Example 6 with ExportLogsServiceRequest

use of io.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest in project opentelemetry-java by open-telemetry.

the class OtlpHttpLogExporterTest method testExportUncompressed.

@Test
void testExportUncompressed() {
    server.enqueue(successResponse());
    OtlpHttpLogExporter exporter = builder.build();
    ExportLogsServiceRequest payload = exportAndAssertResult(exporter, /* expectedResult= */
    true);
    RecordedRequest recorded = server.takeRequest();
    AggregatedHttpRequest request = recorded.request();
    assertRequestCommon(request);
    assertThat(parseRequestBody(request.content().array())).isEqualTo(payload);
    // OkHttp does not support HTTP/2 upgrade on plaintext.
    assertThat(recorded.context().sessionProtocol().isMultiplex()).isFalse();
}
Also used : RecordedRequest(com.linecorp.armeria.testing.junit5.server.mock.RecordedRequest) ExportLogsServiceRequest(io.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest) AggregatedHttpRequest(com.linecorp.armeria.common.AggregatedHttpRequest) Test(org.junit.jupiter.api.Test)

Aggregations

ExportLogsServiceRequest (io.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest)6 Test (org.junit.jupiter.api.Test)5 AggregatedHttpRequest (com.linecorp.armeria.common.AggregatedHttpRequest)4 RecordedRequest (com.linecorp.armeria.testing.junit5.server.mock.RecordedRequest)3 ResourceLogs (io.opentelemetry.proto.logs.v1.ResourceLogs)2 LogData (io.opentelemetry.sdk.logs.data.LogData)2 InvalidProtocolBufferException (com.google.protobuf.InvalidProtocolBufferException)1 Message (com.google.protobuf.Message)1 Status (com.google.rpc.Status)1 HttpMethod (com.linecorp.armeria.common.HttpMethod)1 HttpResponse (com.linecorp.armeria.common.HttpResponse)1 HttpStatus (com.linecorp.armeria.common.HttpStatus)1 MediaType (com.linecorp.armeria.common.MediaType)1 ServerBuilder (com.linecorp.armeria.server.ServerBuilder)1 MockWebServerExtension (com.linecorp.armeria.testing.junit5.server.mock.MockWebServerExtension)1 LogCapturer (io.github.netmikey.logunit.api.LogCapturer)1 Attributes (io.opentelemetry.api.common.Attributes)1 Meter (io.opentelemetry.api.metrics.Meter)1 OkHttpExporter (io.opentelemetry.exporter.internal.okhttp.OkHttpExporter)1 ResourceLogsMarshaler (io.opentelemetry.exporter.internal.otlp.logs.ResourceLogsMarshaler)1