Skip to content

Commit 3d6f0bc

Browse files
cosmo0920edsiper
authored andcommitted
config: Add dead letter queue related config
Signed-off-by: Hiroshi Hatake <hiroshi@chronosphere.io>
1 parent d17e943 commit 3d6f0bc

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

include/fluent-bit/flb_config.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,10 @@ struct flb_config {
254254
char *storage_type; /* global storage type */
255255
int storage_inherit; /* apply storage type to inputs */
256256

257+
/* DLQ for non-retriable output failures */
258+
int storage_keep_rejected; /* 0/1 */
259+
char *storage_rejected_path; /* relative to storage_path, default "rejected" */
260+
257261
/* Embedded SQL Database support (SQLite3) */
258262
#ifdef FLB_HAVE_SQLDB
259263
struct mk_list sqldb_list;
@@ -415,6 +419,9 @@ enum conf_type {
415419
#define FLB_CONF_STORAGE_TRIM_FILES "storage.trim_files"
416420
#define FLB_CONF_STORAGE_TYPE "storage.type"
417421
#define FLB_CONF_STORAGE_INHERIT "storage.inherit"
422+
/* Storage DLQ */
423+
#define FLB_CONF_STORAGE_KEEP_REJECTED "storage.keep.rejected"
424+
#define FLB_CONF_STORAGE_REJECTED_PATH "storage.rejected.path"
418425

419426
/* Coroutines */
420427
#define FLB_CONF_STR_CORO_STACK_SIZE "Coro_Stack_Size"

src/flb_config.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,13 @@ struct flb_service_config service_configs[] = {
164164
{FLB_CONF_STORAGE_INHERIT,
165165
FLB_CONF_TYPE_BOOL,
166166
offsetof(struct flb_config, storage_inherit)},
167+
/* Storage / DLQ */
168+
{FLB_CONF_STORAGE_KEEP_REJECTED,
169+
FLB_CONF_TYPE_BOOL,
170+
offsetof(struct flb_config, storage_keep_rejected)},
171+
{FLB_CONF_STORAGE_REJECTED_PATH,
172+
FLB_CONF_TYPE_STR,
173+
offsetof(struct flb_config, storage_rejected_path)},
167174

168175
/* Coroutines */
169176
{FLB_CONF_STR_CORO_STACK_SIZE,
@@ -351,6 +358,7 @@ struct flb_config *flb_config_init()
351358
config->storage_type = NULL;
352359
config->storage_inherit = FLB_FALSE;
353360
config->storage_bl_flush_on_shutdown = FLB_FALSE;
361+
config->storage_rejected_path = NULL;
354362
config->sched_cap = FLB_SCHED_CAP;
355363
config->sched_base = FLB_SCHED_BASE;
356364
config->json_escape_unicode = FLB_TRUE;
@@ -613,6 +621,9 @@ void flb_config_exit(struct flb_config *config)
613621
if (config->storage_bl_mem_limit) {
614622
flb_free(config->storage_bl_mem_limit);
615623
}
624+
if (config->storage_rejected_path) {
625+
flb_free(config->storage_rejected_path);
626+
}
616627

617628
#ifdef FLB_HAVE_STREAM_PROCESSOR
618629
if (config->stream_processor_file) {

0 commit comments

Comments
 (0)