Base Livecapture Config and Manager Implementations#5971
Conversation
Signed-off-by: Karan Bhakta <kabhakta@amazon.com>
|
@K4ran30 every java file in src/main should have a test file in src/test. Please write tests for all the code. |
Signed-off-by: Karan Bhakta <kabhakta@amazon.com>
|
|
||
| try { | ||
| Map<String, Object> eventData = event.toMap(); | ||
| return activeFilters.entrySet().stream().allMatch(filter -> { |
There was a problem hiding this comment.
You should use DataPrepper expressions instead.
There was a problem hiding this comment.
Would I do this by using the DataPrepper's ExpressionEvaluator?
Signed-off-by: Karan Bhakta <kabhakta@amazon.com>
Signed-off-by: Karan Bhakta <kabhakta@amazon.com>
| public static final String PROCESSOR = "Processor"; | ||
| public static final String ROUTE = "Route"; | ||
| public static final String SINK = "Sink"; | ||
| private static volatile LiveCaptureManager INSTANCE; |
There was a problem hiding this comment.
I am not sure if we need this. For now, we can keep it but we should not need this.
There was a problem hiding this comment.
We should remove this. This LiveCaptureManager can be created as a Spring Bean so that we don't need this at all.
Signed-off-by: Karan Bhakta <kabhakta@amazon.com>
Signed-off-by: Karan Bhakta <kabhakta@amazon.com>
dlvenable
left a comment
There was a problem hiding this comment.
Thanks for this initial PR!
| public static final String PROCESSOR = "Processor"; | ||
| public static final String ROUTE = "Route"; | ||
| public static final String SINK = "Sink"; | ||
| private static volatile LiveCaptureManager INSTANCE; |
There was a problem hiding this comment.
We should remove this. This LiveCaptureManager can be created as a Spring Bean so that we don't need this at all.
| return INSTANCE; | ||
| } | ||
|
|
||
| public static boolean shouldLiveCapture(final Event event) { |
There was a problem hiding this comment.
We should avoid all of these static methods. Use dependency injection where need and have a single instance provided by Spring.
| } | ||
|
|
||
| // turn every entry into a dataprepper event so we can output to sink | ||
| public void processEventLiveCapture(final List<Map<String, Object>> liveCaptureEntries) { |
There was a problem hiding this comment.
We should have a more concrete model than Map<String, Object>.
There was a problem hiding this comment.
Should I introduce model classes for the entries?
| } | ||
| break; | ||
| case PROCESSOR: | ||
| if (name != null) captureMetaData.put("processorName", name); |
There was a problem hiding this comment.
I'm not sure that using Name in the suffix here is quite correct.
For one, we may add an Id concept in the future. For another, these are processor/sink types.
| Map<String, Object> configMap = (Map<String, Object>) sinkConfig; | ||
| // Find the first non-metadata entry to create the sink | ||
| for (Map.Entry<String, Object> entry : configMap.entrySet()) { | ||
| if (!"entry_threshold".equals(entry.getKey()) && !"batch_size".equals(entry.getKey())) { |
There was a problem hiding this comment.
What are these things? entry_threshold and batch_size?
There was a problem hiding this comment.
entry_threshold and batch_size are live capture configuration metadata that users can control through the config file.
Signed-off-by: Karan Bhakta <kabhakta@amazon.com>
…into live-capture # Conflicts: # data-prepper-core/src/main/java/org/opensearch/dataprepper/core/livecapture/LiveCaptureAppConfig.java # data-prepper-core/src/main/java/org/opensearch/dataprepper/core/livecapture/LiveCaptureManager.java # data-prepper-core/src/test/java/org/opensearch/dataprepper/core/livecapture/LiveCaptureAppConfigTest.java
Signed-off-by: Karan Bhakta <kabhakta@amazon.com>
Signed-off-by: Karan Bhakta <123035205+K4ran30@users.noreply.github.com>
Description
This PR introduces the core live capture functionality to Data Prepper, enabling real-time event tracing capabilities. This first commit includes the foundational classes including configuration, event capture coordination, and rate limiting.
Check List
Support live tracking of event transformation #4711
Notes
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.