@@ -91,6 +91,47 @@ Content Data <       |  |  records  |  |
9191Fluent Bit API provides backward compatibility with the previous metadata and content
9292format found on series v1.8.
9393
94+ Starting with the Fluent Bit release that introduces direct route persistence, the
95+ fourth metadata byte now carries feature flags. A zero value preserves the legacy
96+ layout, while a non-zero value indicates that additional structures follow the tag.
97+ When the `` FLB_CHUNK_FLAG_DIRECT_ROUTES ``  bit is set the tag is terminated with a
98+ single `` \0 ``  byte and a routing payload is appended.  Fluent Bit v3.0 and later
99+ also set the `` FLB_CHUNK_FLAG_DIRECT_ROUTE_LABELS ``  bit to store each destination's
100+ alias (or generated name) alongside its numeric identifier so routes can survive
101+ configuration changes that renumber outputs:
102+ 
103+ ``` 
104+ Metadata 
105+                 --   +---------+-------+ 
106+                /     |  0xF1   | 0x77  |  <- Magic Bytes 
107+               /      +---------+-------+ 
108+              <       |  Type   | Flags |  <- Chunk type and flag bits 
109+               \      +---------+-------+ 
110+                \     |      Tag        |  <- Tag string (no size prefix) 
111+                      +---------+-------+ 
112+                      |  0x00   |       |  <- Tag terminator (present when flags != 0) 
113+                      +---------+-------+ 
114+                      | Routing Length  |  <- uint16_t big endian 
115+                      +---------+-------+ 
116+                      | Route Count     |  <- uint16_t big endian 
117+                      +---------+-------+ 
118+                      | Output IDs ...  |  <- Each stored as uint16_t (big endian) 
119+                      +---------+-------+ 
120+                      | Label Lens ...  |  <- Present when FLB_CHUNK_FLAG_DIRECT_ROUTE_LABELS 
121+                      +---------+-------+ 
122+                      | Label Bytes ... |  <- Concatenated label strings (no terminators) 
123+                 --   +-----------------+ 
124+ ``` 
125+ 
126+ The routing payload captures the direct route mapping so that filesystem chunks
127+ loaded by the storage backlog re-use the same outputs after a restart. Chunks
128+ without direct routes keep the legacy layout (flags byte set to zero) and remain
129+ fully backwards compatible across Fluent Bit versions. When labels are stored the
130+ reader first reconstructs routes by matching aliases or numbered names and only
131+ falls back to numeric identifiers if the textual metadata cannot be matched. This
132+ ensures that chunks continue to flow to the intended destinations even when the
133+ output configuration is re-ordered.
134+ 
94135### Fluent Bit <= v1.8  
95136
96137Up to Fluent Bit <= 1.8.x, the metadata and content data is simple, where metadata
0 commit comments