You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adds lexicographical ordering mode for S3 bucket polling.
The input uses the S3 "StartAfter" parameter to resume listing.
For buckets with a large number of objects where object keys
are naturally ordered (ex: timestamp-prefixed), this significantly
reduces the number of objects listed [1] and memory footprint.
The persisted tail key tracks in-flight objects for crash resistance,
ensuring no objects are skipped after an unexpected restart.
Adds 2 new configuration options "lexicographical_ordering" and
"lexicographical_lookback_keys":
- lexicographical_ordering: When set to "true", enables
lexicographical ordering mode. Default is "false".
- lexicographical_lookback_keys: Maintains a bounded lookback
buffer of the N most recently processed keys (default: 100). The
start-after parameter uses the lexicographically oldest key in
the buffer, creating a sliding window that catches late-arriving
objects.
[1] #47926 (comment)
When set to `true`, enables lexicographical ordering mode for S3 bucket polling. In this mode, the input uses the S3 `StartAfter` parameter to resume listing from the last processed object key, which can significantly reduce the number of objects listed in each polling cycle. This is particularly useful for buckets with many objects where object keys are naturally ordered (for example, timestamp-prefixed keys such as `CloudTrail/us-east-1/2025/01/15/log-001.json.gz`).
463
+
464
+
When enabled, the input maintains a state of processed object keys and uses the key which is _lexicographically least_ as the starting point for subsequent list operations. The number of keys tracked is controlled by `lexicographical_lookback_keys`.
465
+
466
+
Default: `false`
467
+
468
+
::::{note}
469
+
This option is only applicable when using S3 bucket polling (`bucket_arn` or `non_aws_bucket_name`). It has no effect when using SQS notifications. Using lexicographical ordering mode assumes that objects written to the bucket are immutable, and any changes to the object remains undetected.
Specifies the maximum number of S3 object keys to track in memory when `lexicographical_ordering` is enabled. This value determines how many recently processed object keys are retained to support the `StartAfter` functionality. The lookback buffer ensures objects that arrive out of lexicographical order (due to late delivery, clock skew, or retries) are still detected and processed.
480
+
481
+
A higher value provides more resilience against reprocessing objects when new objects with older keys arrive, but consumes more memory. A lower value reduces memory usage but can cause more objects to be re-listed if objects with older keys are added to the bucket.
482
+
483
+
Default: `100`
484
+
485
+
::::{note}
486
+
This option only takes effect when `lexicographical_ordering` is set to `true`.
487
+
::::
488
+
489
+
456
490
### `number_of_workers` [_number_of_workers_2]
457
491
458
492
Number of workers that will process the S3 or SQS objects listed. Required when `bucket_arn` or `access_point_arn` is set, otherwise (in the SQS case) defaults to 5.
@@ -1152,5 +1186,8 @@ This input exposes metrics under the [HTTP monitoring endpoint](/reference/fileb
1152
1186
| `s3_events_created_total` | Number of events created from processing S3 data. |
1153
1187
| `s3_objects_inflight_gauge` | Number of S3 objects inflight (gauge). |
1154
1188
| `s3_object_processing_time` | Histogram of the elapsed S3 object processing times in nanoseconds (start of download to completion of parsing). |
1189
+
| `s3_polling_run_time` | Histogram of the elapsed time for each S3 polling run in nanoseconds. Only applicable when using S3 bucket polling. |
1190
+
| `s3_polling_run_time_total` | Cumulative time spent in S3 polling runs in nanoseconds. Only applicable when using S3 bucket polling. |
1191
+
| `s3_objects_listed_per_run` | Histogram of the number of S3 objects listed in each polling run. Only applicable when using S3 bucket polling. |
SQSWaitTime time.Duration`config:"sqs.wait_time"`// The max duration for which the SQS ReceiveMessage call waits for a message to arrive in the queue before returning.
49
-
SQSGraceTime time.Duration`config:"sqs.shutdown_grace_time"`// The time that the processing loop will wait for messages before shutting down.
SQSWaitTime time.Duration`config:"sqs.wait_time"`// The max duration for which the SQS ReceiveMessage call waits for a message to arrive in the queue before returning.
51
+
SQSGraceTime time.Duration`config:"sqs.shutdown_grace_time"`// The time that the processing loop will wait for messages before shutting down.
0 commit comments