Skip to content

4119 tomas#2

Merged
KarstenSchnitter merged 11 commits intoKarstenSchnitter:4119from
sternadsoftware:4119-tomas
Oct 4, 2024
Merged

4119 tomas#2
KarstenSchnitter merged 11 commits intoKarstenSchnitter:4119from
sternadsoftware:4119-tomas

Conversation

@TomasLongo
Copy link
Copy Markdown

No description provided.

Tomas Longo added 10 commits October 4, 2024 11:01
(cherry picked from commit 0d45f77)
Signed-off-by: Tomas Longo <tomas.longo@sap.com>
(cherry picked from commit f8ac48e)
Signed-off-by: Tomas Longo <tomas.longo@sap.com>
(cherry picked from commit ff675dc)
Signed-off-by: Tomas Longo <tomas.longo@sap.com>
(cherry picked from commit 43ba7ee)
Signed-off-by: Tomas Longo <tomas.longo@sap.com>
(cherry picked from commit 1f90615)
Signed-off-by: Tomas Longo <tomas.longo@sap.com>
(cherry picked from commit 2977c1f)
Signed-off-by: Tomas Longo <tomas.longo@sap.com>
(cherry picked from commit 473db0e)
Signed-off-by: Tomas Longo <tomas.longo@sap.com>
(cherry picked from commit 6ef9b7e)
Signed-off-by: Tomas Longo <tomas.longo@sap.com>
(cherry picked from commit 091e9a6)
Signed-off-by: Tomas Longo <tomas.longo@sap.com>
(cherry picked from commit a588b09)
Signed-off-by: Tomas Longo <tomas.longo@sap.com>
@TomasLongo TomasLongo changed the base branch from 4119-tomas to 4119 October 4, 2024 09:27
Copy link
Copy Markdown
Owner

@KarstenSchnitter KarstenSchnitter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR and the effort. Still some minor comments.

retry_info:
min_delay: 1000ms # defaults to 100ms
max_delay: 5s # defaults to 2s

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


### Retry Information

Data Prepper gives clients a hint on how long to wait for the next request in case backpressure builds up. The retry information is implemented as exponential backoff, with a max delay of `retry_info.max_delay`.
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Data Prepper gives clients a hint on how long to wait for the next request in case backpressure builds up. The retry information is implemented as exponential backoff, with a max delay of `retry_info.max_delay`.
Data Prepper replies with a `RetryInfo` specifying how long to wait for the next request in case backpressure builds up. The retry information is implemented as exponential backoff, with a max delay of `retry_info.max_delay`.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Comment on lines +8 to +14
import com.linecorp.armeria.server.encoding.DecodingService;
import org.opensearch.dataprepper.GrpcRequestExceptionHandler;
import org.opensearch.dataprepper.plugins.codec.CompressionOption;
import org.opensearch.dataprepper.plugins.health.HealthGrpcService;
import org.opensearch.dataprepper.plugins.source.otellogs.certificate.CertificateProviderFactory;
import com.linecorp.armeria.server.Server;
import com.linecorp.armeria.server.ServerBuilder;
import com.linecorp.armeria.server.grpc.GrpcService;
import com.linecorp.armeria.server.grpc.GrpcServiceBuilder;
import io.grpc.MethodDescriptor;
import io.grpc.ServerInterceptor;
import io.grpc.ServerInterceptors;
import io.grpc.protobuf.services.ProtoReflectionService;
import java.io.ByteArrayInputStream;
import java.nio.charset.StandardCharsets;
import java.time.Duration;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Executors;
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you do something to your IDE configuration to avoid reordering of the dependencies?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reverted the import order.

Comment on lines +210 to +211
Duration defaultMinDelay = Duration.ofMillis(100);
Duration defaultMaxDelay = Duration.ofMillis(2000);
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Provide these values a constants in the class. You can even just define something like this:

// Default RetryInfo with minimum 100ms and maximum 2s
private final RetryInfoConfig DEFAULT_RETRY_INFO = new RetryInfoConfig(Duration.ofMillis(100), Duration.ofMillis(2000));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

settings.put(SSL_KEY_FILE, sslKeyFile);
settings.put(THREAD_COUNT, threadCount);
settings.put(MAX_CONNECTION_COUNT, maxConnectionCount);
settings.put(OTelLogsSourceConfig.RETRY_INFO, new RetryInfoConfig(Duration.ofMillis(50), Duration.ofMillis(100)));
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can OTelLogsSourceConfig.RETRY_INFO be inlined to RETRY_INFO?

Copy link
Copy Markdown

@i-vim i-vim Oct 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done: Added a static import, if that's what you meant.


### Retry Information

Data Prepper gives clients a hint on how long to wait for the next request in case backpressure builds up. The retry information is implemented as exponential backoff, with a max delay of `retry_info.max_delay`.
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comment in logs source README.md

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


private GrpcExceptionHandlerFunction createGrpExceptionHandler() {
Duration defaultMinDelay = Duration.ofMillis(100);
Duration defaultMaxDelay = Duration.ofMillis(2000);
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comment in OTelLogsSource.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


### Retry Information

Data Prepper gives clients a hint on how long to wait for the next request in case backpressure builds up. The retry information is implemented as exponential backoff, with a max delay of `retry_info.max_delay`.
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comment in logs source README.md.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Comment on lines +212 to +213
Duration defaultMinDelay = Duration.ofMillis(100);
Duration defaultMaxDelay = Duration.ofMillis(2000);
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comment in OTelLogsSource.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Signed-off-by: Tomas Longo <tomas.longo@sap.com>
@KarstenSchnitter KarstenSchnitter merged commit f4b0c60 into KarstenSchnitter:4119 Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants