Skip to content

Commit eda0df9

Browse files
committed
input_chunk: add direct route labels and plugin name support
Add new metadata flags and structures for storing output labels (aliases/generated names) and plugin names in chunk metadata. This enables routing to survive configuration changes by matching outputs by name instead of numeric IDs. - Add FLB_CHUNK_FLAG_DIRECT_ROUTE_LABELS flag - Add FLB_CHUNK_FLAG_DIRECT_ROUTE_PLUGIN_IDS flag - Add label_is_alias and plugin_name fields to flb_chunk_direct_route - Add new function declarations for label-based route matching Signed-off-by: Eduardo Silva <[email protected]>
1 parent e615c83 commit eda0df9

File tree

2 files changed

+437
-44
lines changed

2 files changed

+437
-44
lines changed

include/fluent-bit/flb_input_chunk.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,20 @@ struct cio_chunk;
4949
#define FLB_CHUNK_FLAG_DIRECT_ROUTES (1 << 0)
5050
#define FLB_CHUNK_FLAG_DIRECT_ROUTE_LABELS (1 << 1)
5151
#define FLB_CHUNK_FLAG_DIRECT_ROUTE_WIDE_IDS (1 << 2)
52+
#define FLB_CHUNK_FLAG_DIRECT_ROUTE_PLUGIN_IDS (1 << 3)
53+
54+
#define FLB_CHUNK_DIRECT_ROUTE_LABEL_ALIAS_FLAG 0x8000
55+
#define FLB_CHUNK_DIRECT_ROUTE_LABEL_LENGTH_MASK 0x7FFF
56+
57+
struct flb_output_instance;
5258

5359
struct flb_chunk_direct_route {
5460
uint32_t id;
5561
uint16_t label_length;
5662
const char *label;
63+
uint8_t label_is_alias;
64+
uint16_t plugin_name_length;
65+
const char *plugin_name;
5766
};
5867

5968
/* Chunks magic bytes (starting from Fluent Bit v1.8.10) */
@@ -129,6 +138,8 @@ int flb_input_chunk_write_header_v2(struct cio_chunk *chunk,
129138
char *tag, int tag_len,
130139
const struct flb_chunk_direct_route *routes,
131140
int route_count);
141+
int flb_chunk_route_plugin_matches(struct flb_output_instance *o_ins,
142+
const struct flb_chunk_direct_route *route);
132143
int flb_input_chunk_has_direct_routes(struct flb_input_chunk *ic);
133144
int flb_input_chunk_get_direct_routes(struct flb_input_chunk *ic,
134145
struct flb_chunk_direct_route **routes,

0 commit comments

Comments
 (0)