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

[Backport 2.10] Fix otel_logs_source server configuration for getHttpAuthenticationService #5215

Merged
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 @@ -5,6 +5,7 @@

package org.opensearch.dataprepper.plugins.source.otellogs;

import com.linecorp.armeria.server.HttpService;
import com.linecorp.armeria.server.encoding.DecodingService;
import org.opensearch.dataprepper.GrpcRequestExceptionHandler;
import org.opensearch.dataprepper.plugins.codec.CompressionOption;
Expand Down Expand Up @@ -45,8 +46,10 @@
import java.nio.charset.StandardCharsets;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Executors;
import java.util.function.Function;

@DataPrepperPlugin(name = "otel_logs_source", pluginType = Source.class, pluginConfigurationType = OTelLogsSourceConfig.class)
public class OTelLogsSource implements Source<Record<Object>> {
Expand Down Expand Up @@ -141,6 +144,13 @@ public void start(Buffer<Record<Object>> buffer) {
} else {
sb.service(grpcServiceBuilder.build(), DecodingService.newDecorator());
}

if (oTelLogsSourceConfig.getAuthentication() != null) {
final Optional<Function<? super HttpService, ? extends HttpService>> optionalHttpAuthenticationService =
authenticationProvider.getHttpAuthenticationService();
optionalHttpAuthenticationService.ifPresent(sb::decorator);
}

sb.requestTimeoutMillis(oTelLogsSourceConfig.getRequestTimeoutInMillis());
if(oTelLogsSourceConfig.getMaxRequestLength() != null) {
sb.maxRequestLength(oTelLogsSourceConfig.getMaxRequestLength().getBytes());
Expand Down
Loading