Commit a06ca3c
input_log: account input metrics once before route fan-out
Counting the input metrics on the base append while the per-route copies
are skipped leaves a gap under backpressure. A route copy can succeed,
push the input over its memory or storage limit and pause it via
flb_input_chunk_protect(), or the base append can fail after some copies
were already delivered. In both cases the base append returns before
counting, so records already queued for a route go unreflected in
fluentbit_input_records_total and fluentbit_input_bytes_total.
Account the original ingestion exactly once at the routing boundary,
before the split, gated by the entry pause state, and mark the base
append with FLB_INPUT_CHUNK_SKIP_INPUT_METRICS as the per-route copies
already are. Counting up front keeps the totals correct regardless of
which downstream append later pauses or fails. The plain non-routed path
is unchanged and keeps counting inside flb_input_chunk_append_raw().
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: zshuang0316 <zshuang0316@163.com>1 parent b956a77 commit a06ca3c
1 file changed
Lines changed: 38 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1482 | 1482 | | |
1483 | 1483 | | |
1484 | 1484 | | |
| 1485 | + | |
1485 | 1486 | | |
1486 | 1487 | | |
1487 | 1488 | | |
| |||
1501 | 1502 | | |
1502 | 1503 | | |
1503 | 1504 | | |
| 1505 | + | |
| 1506 | + | |
| 1507 | + | |
| 1508 | + | |
| 1509 | + | |
| 1510 | + | |
| 1511 | + | |
| 1512 | + | |
| 1513 | + | |
| 1514 | + | |
| 1515 | + | |
| 1516 | + | |
| 1517 | + | |
| 1518 | + | |
| 1519 | + | |
| 1520 | + | |
| 1521 | + | |
| 1522 | + | |
| 1523 | + | |
| 1524 | + | |
| 1525 | + | |
| 1526 | + | |
| 1527 | + | |
| 1528 | + | |
| 1529 | + | |
| 1530 | + | |
| 1531 | + | |
| 1532 | + | |
1504 | 1533 | | |
1505 | 1534 | | |
1506 | 1535 | | |
| |||
1515 | 1544 | | |
1516 | 1545 | | |
1517 | 1546 | | |
1518 | | - | |
| 1547 | + | |
| 1548 | + | |
| 1549 | + | |
1519 | 1550 | | |
1520 | 1551 | | |
1521 | | - | |
1522 | | - | |
| 1552 | + | |
| 1553 | + | |
| 1554 | + | |
1523 | 1555 | | |
1524 | 1556 | | |
1525 | | - | |
1526 | | - | |
| 1557 | + | |
| 1558 | + | |
| 1559 | + | |
1527 | 1560 | | |
1528 | 1561 | | |
1529 | 1562 | | |
| |||
0 commit comments