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

Fix otel_logs_source server configuration for getHttpAuthenticationService #5212

Merged
merged 1 commit into from
Nov 21, 2024
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 @@ -6,6 +6,7 @@
package org.opensearch.dataprepper.plugins.source.otellogs;

import com.linecorp.armeria.common.grpc.GrpcExceptionHandlerFunction;
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 @@ -47,8 +48,10 @@
import java.time.Duration;
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 @@ -144,6 +147,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